github.com/nozzle/golangci-lint@v1.49.0-nz3/test/testdata/goconst_ignore_test.go (about) 1 //golangcitest:args -Egoconst 2 //golangcitest:config_path testdata/configs/goconst_ignore.yml 3 //golangcitest:expected_exitcode 0 4 package testdata 5 6 import ( 7 "fmt" 8 "testing" 9 ) 10 11 func TestGoConstA(t *testing.T) { 12 a := "needconst" 13 fmt.Print(a) 14 b := "needconst" 15 fmt.Print(b) 16 c := "needconst" 17 fmt.Print(c) 18 } 19 20 func TestGoConstB(t *testing.T) { 21 a := "needconst" 22 fmt.Print(a) 23 b := "needconst" 24 fmt.Print(b) 25 } 26 27 const AlreadyHasConst = "alreadyhasconst" 28 29 func TestGoConstC(t *testing.T) { 30 a := "alreadyhasconst" 31 fmt.Print(a) 32 b := "alreadyhasconst" 33 fmt.Print(b) 34 c := "alreadyhasconst" 35 fmt.Print(c) 36 fmt.Print("alreadyhasconst") 37 }