Skip to content

Commit 5215153

Browse files
committed
Add test with settings
1 parent a4867ae commit 5215153

File tree

2 files changed

+12
-2
lines changed

2 files changed

+12
-2
lines changed

test/testdata/configs/reassign.yml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
linter-settings:
2+
reassign:
3+
patterns:
4+
- EOF
5+
- DefaultClient

test/testdata/reassign.go

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,13 @@
11
//golangcitest:args -Ereassign
2+
//golangcitest:config_path testdata/configs/reassign.yml
23
package testdata
34

4-
import "io"
5+
import (
6+
"io"
7+
"net/http"
8+
)
59

610
func breakIO() {
7-
io.EOF = nil // ERROR `reassigning variable EOF in other package io`
11+
http.DefaultClient = nil // ERROR `reassigning variable DefaultClient in other package http`
12+
io.EOF = nil // ERROR `reassigning variable EOF in other package io`
813
}

0 commit comments

Comments
 (0)