Skip to content

Commit 286471f

Browse files
committed
test: added stdlib test
1 parent 381e9e5 commit 286471f

File tree

2 files changed

+20
-1
lines changed

2 files changed

+20
-1
lines changed
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
linters-settings:
2+
ireturn:
3+
reject:
4+
- stdlib

test/testdata/ireturn_reject_stdlib.go

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,22 @@ import (
77
"io"
88
)
99

10-
func NewAllowDoer() io.Writer {
10+
func NewWriter() io.Writer { // ERROR `NewWriter returns interface \(io.Writer\)`
1111
var buf bytes.Buffer
1212
return &buf
1313
}
14+
15+
func TestError() error {
16+
return nil
17+
}
18+
19+
type Foo interface {
20+
Foo()
21+
}
22+
type foo int
23+
24+
func (f foo) Foo() {}
25+
26+
func NewFoo() Foo {
27+
return foo(1)
28+
}

0 commit comments

Comments
 (0)