Skip to content

Commit 381e9e5

Browse files
committed
fix: added WithLoadForGoAnalysis() to support standard library + test
1 parent 0b69514 commit 381e9e5

File tree

3 files changed

+14
-0
lines changed

3 files changed

+14
-0
lines changed

pkg/lint/lintersdb/manager.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -511,6 +511,7 @@ func (m Manager) GetAllSupportedLinterConfigs() []*linter.Config {
511511
linter.NewConfig(golinters.NewIreturn(ireturnCfg)).
512512
WithSince("v1.43.0").
513513
WithPresets(linter.PresetStyle).
514+
WithLoadForGoAnalysis().
514515
WithURL("https://github.com/butuzov/ireturn"),
515516

516517
// nolintlint must be last because it looks at the results of all the previous linters for unused nolint directives

test/testdata/configs/ireturn_stdlib_reject.yml

Whitespace-only changes.
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
// args: -Eireturn
2+
// config_path: testdata/configs/ireturn_stdlib_reject.yml
3+
package testdata
4+
5+
import (
6+
"bytes"
7+
"io"
8+
)
9+
10+
func NewAllowDoer() io.Writer {
11+
var buf bytes.Buffer
12+
return &buf
13+
}

0 commit comments

Comments
 (0)