Merge pull request #117716 from thockin/validation_test_whitespace

Clean up brace whitespace in **/validation_test.go

Kubernetes-commit: 2e78e07ee56e4c7a6e764af39735a36454768ab4
This commit is contained in:
Kubernetes Publisher 2023-05-02 10:02:25 -07:00
commit d8abacd71f
3 changed files with 29 additions and 35 deletions

4
go.mod
View File

@ -24,7 +24,7 @@ require (
golang.org/x/time v0.3.0
google.golang.org/protobuf v1.30.0
k8s.io/api v0.0.0-20230502053112-cdff1d4efea5
k8s.io/apimachinery v0.0.0-20230502013411-c11b0f21a18f
k8s.io/apimachinery v0.0.0-20230502170225-db7f55599f0e
k8s.io/klog/v2 v2.90.1
k8s.io/kube-openapi v0.0.0-20230501164219-8b0f38b5fd1f
k8s.io/utils v0.0.0-20230209194617-a36077c30491
@ -60,5 +60,5 @@ require (
replace (
k8s.io/api => k8s.io/api v0.0.0-20230502053112-cdff1d4efea5
k8s.io/apimachinery => k8s.io/apimachinery v0.0.0-20230502013411-c11b0f21a18f
k8s.io/apimachinery => k8s.io/apimachinery v0.0.0-20230502170225-db7f55599f0e
)

4
go.sum
View File

@ -480,8 +480,8 @@ honnef.co/go/tools v0.0.1-2020.1.3/go.mod h1:X/FiERA/W4tHapMX5mGpAtMSVEeEUOyHaw9
honnef.co/go/tools v0.0.1-2020.1.4/go.mod h1:X/FiERA/W4tHapMX5mGpAtMSVEeEUOyHaw9vFzvIQ3k=
k8s.io/api v0.0.0-20230502053112-cdff1d4efea5 h1:AAFiq+OLQqeMCf6esHsifDHaYsFfvBJhTg6jd27vevM=
k8s.io/api v0.0.0-20230502053112-cdff1d4efea5/go.mod h1:nfd0ttnXD79Rj548Bl1hfHBh9J38Is9kBvnnhBtdHQc=
k8s.io/apimachinery v0.0.0-20230502013411-c11b0f21a18f h1:mO0WE9xlbKiSIYzK7L9SIOkq9s9tLZDZIrLLzXQt3kU=
k8s.io/apimachinery v0.0.0-20230502013411-c11b0f21a18f/go.mod h1:D/d0HgOLmg6/40zRBT8Tzb0OSoysLc8CBtPty5QmjEM=
k8s.io/apimachinery v0.0.0-20230502170225-db7f55599f0e h1:IRz3WDUSgheN7mj2QnMRqvhGYR9i0Zv3ErJSyZNrUXk=
k8s.io/apimachinery v0.0.0-20230502170225-db7f55599f0e/go.mod h1:D/d0HgOLmg6/40zRBT8Tzb0OSoysLc8CBtPty5QmjEM=
k8s.io/klog/v2 v2.90.1 h1:m4bYOKall2MmOiRaR1J+We67Do7vm9KiQVlT96lnHUw=
k8s.io/klog/v2 v2.90.1/go.mod h1:y1WjHnz7Dj687irZUWR/WLkLc5N1YHtjLdmgWjndZn0=
k8s.io/kube-openapi v0.0.0-20230501164219-8b0f38b5fd1f h1:2kWPakN3i/k81b0gvD5C5FJ2kxm1WrQFanWchyKuqGg=

View File

@ -748,37 +748,31 @@ func TestErrConfigurationInvalidWithErrorsIs(t *testing.T) {
err error
matchAgainst error
expectMatch bool
}{
{
name: "no match",
err: errConfigurationInvalid{errors.New("my-error"), errors.New("my-other-error")},
matchAgainst: fmt.Errorf("no entry %s", "here"),
},
{
name: "match via .Is()",
err: errConfigurationInvalid{errors.New("forbidden"), alwaysMatchingError{}},
matchAgainst: errors.New("unauthorized"),
expectMatch: true,
},
{
name: "match via equality",
err: errConfigurationInvalid{errors.New("err"), someError{}},
matchAgainst: someError{},
expectMatch: true,
},
{
name: "match via nested aggregate",
err: errConfigurationInvalid{errors.New("closed today"), errConfigurationInvalid{errConfigurationInvalid{someError{}}}},
matchAgainst: someError{},
expectMatch: true,
},
{
name: "match via wrapped aggregate",
err: fmt.Errorf("wrap: %w", errConfigurationInvalid{errors.New("err"), someError{}}),
matchAgainst: someError{},
expectMatch: true,
},
}
}{{
name: "no match",
err: errConfigurationInvalid{errors.New("my-error"), errors.New("my-other-error")},
matchAgainst: fmt.Errorf("no entry %s", "here"),
}, {
name: "match via .Is()",
err: errConfigurationInvalid{errors.New("forbidden"), alwaysMatchingError{}},
matchAgainst: errors.New("unauthorized"),
expectMatch: true,
}, {
name: "match via equality",
err: errConfigurationInvalid{errors.New("err"), someError{}},
matchAgainst: someError{},
expectMatch: true,
}, {
name: "match via nested aggregate",
err: errConfigurationInvalid{errors.New("closed today"), errConfigurationInvalid{errConfigurationInvalid{someError{}}}},
matchAgainst: someError{},
expectMatch: true,
}, {
name: "match via wrapped aggregate",
err: fmt.Errorf("wrap: %w", errConfigurationInvalid{errors.New("err"), someError{}}),
matchAgainst: someError{},
expectMatch: true,
}}
for _, tc := range testCases {
t.Run(tc.name, func(t *testing.T) {