MCPcopy
hub / github.com/go-playground/validator / Namespace

Method Namespace

errors.go:103–103  ·  view source on GitHub ↗

Namespace returns the namespace for the field error, with the tag name taking precedence over the field's actual name. eg. JSON name "User.fname" See StructNamespace() for a version that returns actual names. NOTE: this field can be blank when validating a single primitive field using validate.Fi

()

Source from the content-addressed store, hash-verified

101 // NOTE: this field can be blank when validating a single primitive field
102 // using validate.Field(...) as there is no way to extract it's name
103 Namespace() string
104
105 // StructNamespace returns the namespace for the field error, with the field's
106 // actual name.

Callers 15

TestKeysCustomValidationFunction · 0.95
AssertErrorFunction · 0.65
AssertDeepErrorFunction · 0.65
getErrorFunction · 0.65
TestNameNamespaceFunction · 0.65
TestTranslationsFunction · 0.65
TestIsDefaultFunction · 0.65
TestValidateFnFunction · 0.65

Implementers 1

fieldErrorerrors.go

Calls

no outgoing calls

Tested by 15

TestKeysCustomValidationFunction · 0.76
AssertErrorFunction · 0.52
AssertDeepErrorFunction · 0.52
getErrorFunction · 0.52
TestNameNamespaceFunction · 0.52
TestTranslationsFunction · 0.52
TestIsDefaultFunction · 0.52
TestValidateFnFunction · 0.52