mirror of https://github.com/knative/pkg.git
flipped the error text around. fixed. (#36)
This commit is contained in:
parent
c1e9219cee
commit
5182837041
|
@ -116,7 +116,7 @@ func ErrInvalidValue(value, fieldPath string) *FieldError {
|
|||
// not having at least one field in a mutually exclusive field group.
|
||||
func ErrMissingOneOf(fieldPaths ...string) *FieldError {
|
||||
return &FieldError{
|
||||
Message: "expected exactly one, got both",
|
||||
Message: "expected exactly one, got neither",
|
||||
Paths: fieldPaths,
|
||||
}
|
||||
}
|
||||
|
@ -125,7 +125,7 @@ func ErrMissingOneOf(fieldPaths ...string) *FieldError {
|
|||
// for having more than one field set in a mutually exclusive field group.
|
||||
func ErrMultipleOneOf(fieldPaths ...string) *FieldError {
|
||||
return &FieldError{
|
||||
Message: "expected exactly one, got neither",
|
||||
Message: "expected exactly one, got both",
|
||||
Paths: fieldPaths,
|
||||
}
|
||||
}
|
||||
|
|
|
@ -105,12 +105,12 @@ Body.`,
|
|||
name: "missing mutually exclusive fields",
|
||||
err: ErrMissingOneOf("foo", "bar"),
|
||||
prefixes: [][]string{{"baz"}},
|
||||
want: `expected exactly one, got both: baz.foo, baz.bar`,
|
||||
want: `expected exactly one, got neither: baz.foo, baz.bar`,
|
||||
}, {
|
||||
name: "multiple mutually exclusive fields",
|
||||
err: ErrMultipleOneOf("foo", "bar"),
|
||||
prefixes: [][]string{{"baz"}},
|
||||
want: `expected exactly one, got neither: baz.foo, baz.bar`,
|
||||
want: `expected exactly one, got both: baz.foo, baz.bar`,
|
||||
},{
|
||||
name: "invalid key name",
|
||||
err: ErrInvalidKeyName("b@r", "foo[0].name",
|
||||
|
|
Loading…
Reference in New Issue