Skip to content

Commit

Permalink
Add a missing name to the *testing.T argument. (#425)
Browse files Browse the repository at this point in the history
When using t.Run, the subtest must take a named *testing.T argument. Otherwise, inner calls to t.Error etc. are invoked on the outer test object, which is pretty much always wrong.

Signed-off-by: Matt Harden <matt.harden@gmail.com>
  • Loading branch information
nerdatmath committed Dec 13, 2021
1 parent 0f8a320 commit 5bd7067
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion proc_psi_test.go
Expand Up @@ -19,7 +19,7 @@ import (
)

func TestPSIStats(t *testing.T) {
t.Run("fake", func(*testing.T) {
t.Run("fake", func(t *testing.T) {
stats, err := getProcFixtures(t).PSIStatsForResource("fake")
if err == nil {
t.Fatal("fake resource does not have PSI statistics")
Expand Down

0 comments on commit 5bd7067

Please sign in to comment.