Skip to content

Commit a048ca8

Browse files
Merge pull request #274 from sapcc/must-t-helper
must: fix missing t.Helper()
2 parents 40e7a0c + d018227 commit a048ca8

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

must/must.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@ func Succeed(err error) {
3333
// SucceedT is a variant of Succeed() for use in unit tests.
3434
// Instead of exiting the program, any non-nil errors are reported with t.Fatal().
3535
func SucceedT(t *testing.T, err error) {
36+
t.Helper()
3637
if err != nil {
3738
t.Fatal(err.Error())
3839
}
@@ -74,6 +75,7 @@ func ReturnT[V any](val V, err error) func(*testing.T) V {
7475
// because filling multiple arguments using a call expression with multiple return values
7576
// is only allowed when there are no other arguments.
7677
return func(t *testing.T) V {
78+
t.Helper()
7779
SucceedT(t, err)
7880
return val
7981
}

0 commit comments

Comments
 (0)