go-critic / go-critic

The most opinionated Go source code linter for code audit.
https://go-critic.com
MIT License
1.82k stars 114 forks source link

lint: consider to add helper marker for functions in test files #210

Open cristaloleg opened 6 years ago

cristaloleg commented 6 years ago

before:

// code_test.go
func testHelper(t *testing.T, params ...interface{}) interface{} {
    ...
}

after:

// code_test.go
func testHelper(t *testing.T, params ...interface{}) interface{} {
    t.Helper()
    ...
}

This will exclude noisy(?) testHelper from a stacktrace.

Antonboom commented 9 months ago

Covered by https://golangci-lint.run/usage/linters/#thelper