@@ -90,13 +90,12 @@ func Test_isAllowedEnvVariable(t *testing.T) {
9090 },
9191 }
9292 for _ , tt := range tests {
93- tt := tt // Re-initializing variable so it is not changed while executing the closure below
9493 t .Run (tt .name , func (t * testing.T ) {
9594 t .Parallel ()
9695
9796 r := isAllowedEnvVariable (tt .variable )
9897 if ! cmp .Equal (r , tt .expected ) {
99- t .Errorf (cmp .Diff (r , tt .expected ))
98+ t .Error (cmp .Diff (r , tt .expected ))
10099 }
101100 })
102101 }
@@ -126,7 +125,6 @@ func Test_getOutputBinaryPath(t *testing.T) {
126125 },
127126 }
128127 for _ , tt := range tests {
129- tt := tt // Re-initializing variable so it is not changed while executing the closure below
130128 t .Run (tt .name , func (t * testing.T ) {
131129 t .Parallel ()
132130
@@ -140,7 +138,7 @@ func Test_getOutputBinaryPath(t *testing.T) {
140138 }
141139
142140 if ! cmp .Equal (r , tt .path ) {
143- t .Errorf (cmp .Diff (r , tt .path ))
141+ t .Error (cmp .Diff (r , tt .path ))
144142 }
145143 })
146144 }
@@ -177,13 +175,12 @@ func Test_isAllowedArg(t *testing.T) {
177175 })
178176 }
179177 for _ , tt := range tests {
180- tt := tt // Re-initializing variable so it is not changed while executing the closure below
181178 t .Run (tt .name , func (t * testing.T ) {
182179 t .Parallel ()
183180
184181 r := isAllowedArg (tt .argument )
185182 if ! cmp .Equal (r , tt .expected ) {
186- t .Errorf (cmp .Diff (r , tt .expected ))
183+ t .Error (cmp .Diff (r , tt .expected ))
187184 }
188185 })
189186 }
@@ -442,7 +439,6 @@ func Test_generateOutputFilename(t *testing.T) {
442439 }
443440
444441 for _ , tt := range tests {
445- tt := tt // Re-initializing variable so it is not changed while executing the closure below
446442 t .Run (tt .name , func (t * testing.T ) {
447443 // Note: disable parallelism to avoid env variable clobbering between tests.
448444 // t.Parallel()
@@ -491,7 +487,7 @@ func Test_generateOutputFilename(t *testing.T) {
491487 }
492488
493489 if fn != tt .expected .fn {
494- t .Errorf (cmp .Diff (fn , tt .expected .fn ))
490+ t .Error (cmp .Diff (fn , tt .expected .fn ))
495491 }
496492 })
497493 }
@@ -595,7 +591,6 @@ func Test_SetArgEnvVariables(t *testing.T) {
595591 }
596592
597593 for _ , tt := range tests {
598- tt := tt // Re-initializing variable so it is not changed while executing the closure below
599594 t .Run (tt .name , func (t * testing.T ) {
600595 t .Parallel ()
601596
@@ -619,7 +614,7 @@ func Test_SetArgEnvVariables(t *testing.T) {
619614
620615 sorted := cmpopts .SortSlices (func (a , b string ) bool { return a < b })
621616 if ! cmp .Equal (b .argEnv , tt .expected .env , sorted ) {
622- t .Errorf (cmp .Diff (b .argEnv , tt .expected .env ))
617+ t .Error (cmp .Diff (b .argEnv , tt .expected .env ))
623618 }
624619 })
625620 }
@@ -704,7 +699,6 @@ func Test_generateEnvVariables(t *testing.T) {
704699 }
705700
706701 for _ , tt := range tests {
707- tt := tt // Re-initializing variable so it is not changed while executing the closure below
708702 t .Run (tt .name , func (t * testing.T ) {
709703 t .Parallel ()
710704
@@ -731,7 +725,7 @@ func Test_generateEnvVariables(t *testing.T) {
731725 expectedFlags := tt .expected .flags
732726 sorted := cmpopts .SortSlices (func (a , b string ) bool { return a < b })
733727 if ! cmp .Equal (flags , expectedFlags , sorted ) {
734- t .Errorf (cmp .Diff (flags , expectedFlags ))
728+ t .Error (cmp .Diff (flags , expectedFlags ))
735729 }
736730 })
737731 }
@@ -862,7 +856,6 @@ func Test_generateLdflags(t *testing.T) {
862856 }
863857
864858 for _ , tt := range tests {
865- tt := tt // Re-initializing variable so it is not changed while executing the closure below
866859 t .Run (tt .name , func (t * testing.T ) {
867860 // Disable to avoid env clobbering between tests.
868861 // t.Parallel()
@@ -905,7 +898,7 @@ func Test_generateLdflags(t *testing.T) {
905898 }
906899 // Note: generated env variables contain the process's env variables too.
907900 if ! cmp .Equal (ldflags , tt .outldflags ) {
908- t .Errorf (cmp .Diff (ldflags , tt .outldflags ))
901+ t .Error (cmp .Diff (ldflags , tt .outldflags ))
909902 }
910903 })
911904 }
@@ -954,7 +947,6 @@ func Test_generateFlags(t *testing.T) {
954947 }
955948
956949 for _ , tt := range tests {
957- tt := tt // Re-initializing variable so it is not changed while executing the closure below
958950 t .Run (tt .name , func (t * testing.T ) {
959951 t .Parallel ()
960952
@@ -980,7 +972,7 @@ func Test_generateFlags(t *testing.T) {
980972 // Note: generated env variables contain the process's env variables too.
981973 sorted := cmpopts .SortSlices (func (a , b string ) bool { return a < b })
982974 if ! cmp .Equal (flags , expectedFlags , sorted ) {
983- t .Errorf (cmp .Diff (flags , expectedFlags ))
975+ t .Error (cmp .Diff (flags , expectedFlags ))
984976 }
985977 })
986978 }
@@ -1024,7 +1016,6 @@ func Test_generateCommand(t *testing.T) {
10241016 }
10251017
10261018 for _ , tt := range tests {
1027- tt := tt // Re-initializing variable so it is not changed while executing the closure below
10281019 t .Run (tt .name , func (t * testing.T ) {
10291020 t .Parallel ()
10301021
@@ -1056,7 +1047,7 @@ func Test_generateCommand(t *testing.T) {
10561047
10571048 sorted := cmpopts .SortSlices (func (a , b string ) bool { return a < b })
10581049 if ! cmp .Equal (command , expectedCommand , sorted ) {
1059- t .Errorf (cmp .Diff (command , expectedCommand ))
1050+ t .Error (cmp .Diff (command , expectedCommand ))
10601051 }
10611052 }
10621053 })
0 commit comments