Skip to content

Commit

Permalink
Add test with settings
Browse files Browse the repository at this point in the history
  • Loading branch information
chokoswitch committed Aug 23, 2022
1 parent a4867ae commit 5215153
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 2 deletions.
5 changes: 5 additions & 0 deletions test/testdata/configs/reassign.yml
@@ -0,0 +1,5 @@
linter-settings:
reassign:
patterns:
- EOF
- DefaultClient
9 changes: 7 additions & 2 deletions test/testdata/reassign.go
@@ -1,8 +1,13 @@
//golangcitest:args -Ereassign
//golangcitest:config_path testdata/configs/reassign.yml
package testdata

import "io"
import (
"io"
"net/http"
)

func breakIO() {
io.EOF = nil // ERROR `reassigning variable EOF in other package io`
http.DefaultClient = nil // ERROR `reassigning variable DefaultClient in other package http`
io.EOF = nil // ERROR `reassigning variable EOF in other package io`
}

0 comments on commit 5215153

Please sign in to comment.