From 521515308979cdc08fa9392217e5998b79060e26 Mon Sep 17 00:00:00 2001 From: Choko Date: Tue, 23 Aug 2022 15:23:55 +0900 Subject: [PATCH] Add test with settings --- test/testdata/configs/reassign.yml | 5 +++++ test/testdata/reassign.go | 9 +++++++-- 2 files changed, 12 insertions(+), 2 deletions(-) create mode 100644 test/testdata/configs/reassign.yml diff --git a/test/testdata/configs/reassign.yml b/test/testdata/configs/reassign.yml new file mode 100644 index 000000000000..7037defc92e5 --- /dev/null +++ b/test/testdata/configs/reassign.yml @@ -0,0 +1,5 @@ +linter-settings: + reassign: + patterns: + - EOF + - DefaultClient \ No newline at end of file diff --git a/test/testdata/reassign.go b/test/testdata/reassign.go index cdb4550a93ac..fdecde5feb0c 100644 --- a/test/testdata/reassign.go +++ b/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` }