Created
May 29, 2020 16:00
-
-
Save nullren/2dc79c167195a964118919e28ba679bf to your computer and use it in GitHub Desktop.
Revisions
-
Renning Bruns revised this gist
May 29, 2020 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -9,7 +9,7 @@ func TestTheTestcases(t *testing.T) { testcases := []*testcase{...} for _, test := range testcases { // this is needed to keep `test` in scope. are there alternatives to this pattern? test := test t.Run(test.name, func(t *testing.T) { ... -
Renning Bruns created this gist
May 29, 2020 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,18 @@ package example type testcase struct { name string ... } func TestTheTestcases(t *testing.T) { testcases := []*testcase{...} for _, test := range testcases { // this is needed to keep `test` in scope. are there alternatives to this pattern? test := test t.Run(test.name, func(t *testing.T) { ... }) } }