From 54190dfee5216210b6d6ca2d7e2b7b6374f0fe8e Mon Sep 17 00:00:00 2001 From: Tim Hockin Date: Tue, 2 May 2023 00:36:15 -0700 Subject: [PATCH] Clean up brace whitespace in **/validation_test.go This was making my eyes bleed as I read over code. I used the following in vim. I made them up on the fly, but they seemed to pass manual inspection. :g/},\n\s*{$/s//}, {/ :w :g/{$\n\s*{$/s//{{/ :w :g/^\(\s*\)},\n\1},$/s//}},/ :w :g/^\(\s*\)},$\n\1}$/s//}}/ :w Kubernetes-commit: d55b67b349021b6c46fc6ce78f2a36bd4217145f --- tools/clientcmd/validation_test.go | 56 +++++++++++++----------------- 1 file changed, 25 insertions(+), 31 deletions(-) diff --git a/tools/clientcmd/validation_test.go b/tools/clientcmd/validation_test.go index 7b8e2fd5..3c56498a 100644 --- a/tools/clientcmd/validation_test.go +++ b/tools/clientcmd/validation_test.go @@ -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) {