diff options
-rw-r--r-- | config/policy.go | 2 | ||||
-rw-r--r-- | config/validation.go | 6 |
2 files changed, 4 insertions, 4 deletions
diff --git a/config/policy.go b/config/policy.go index 25fe02a..f143f1a 100644 --- a/config/policy.go +++ b/config/policy.go @@ -20,7 +20,7 @@ type Policy struct { // Validate checks the given config against all policy enforcements. // func (pol Policy) Validate(config Config) error { - validate := NewValidator() + validate := newValidator() for _, enforcement := range pol.Enforcements { cfg, err := ResolveYAMLPath(enforcement.Path, config) diff --git a/config/validation.go b/config/validation.go index 3359211..646e49d 100644 --- a/config/validation.go +++ b/config/validation.go @@ -63,10 +63,10 @@ type ctxKey uint8 const rootCfgCtx ctxKey = iota -// NewValidator returns a validator instance for which our custom aliases and +// newValidator returns a validator instance for which our custom aliases and // functions are registered. // -func NewValidator() *validator.Validate { +func newValidator() *validator.Validate { validate := validator.New() validate.RegisterTagNameFunc(resolveYAMLTagName) @@ -87,7 +87,7 @@ func NewValidator() *validator.Validate { // user-friendly message describing all invalid field values. // func Validate(config Config) error { - validate := NewValidator() + validate := newValidator() ctx := context.WithValue(context.Background(), rootCfgCtx, config) |