/
valid.go
30 lines (24 loc) · 1.03 KB
/
valid.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
// Copyright 2015-2020 Bret Jordan, All rights reserved.
//
// Use of this source code is governed by an Apache 2.0 license that can be
// found in the LICENSE file in the root of the source tree.
package location
// ----------------------------------------------------------------------
// Public Methods
// ----------------------------------------------------------------------
/* Valid - This method will verify and test all of the properties on an object
to make sure they are valid per the specification. It will return a boolean, an
integer that tracks the number of problems found, and a slice of strings that
contain the detailed results, whether good or bad. */
func (o *Location) Valid() (bool, int, []string) {
problemsFound := 0
resultDetails := make([]string, 0)
// Check common base properties first
_, pBase, dBase := o.CommonObjectProperties.ValidSDO()
problemsFound += pBase
resultDetails = append(resultDetails, dBase...)
if problemsFound > 0 {
return false, problemsFound, resultDetails
}
return true, 0, resultDetails
}