golangci-lint/test/testdata/goconst_calls_enabled.go
iwankgb 993337baa2
Using upstrem goconst (#1500)
github.com/golangci/goconst is now obsolete :)
2020-11-17 19:07:37 +00:00

18 lines
340 B
Go

//args: -Egoconst
//config: linters-settings.goconst.ignore-calls=false
package testdata
import "fmt"
const FooBar = "foobar"
func Baz() {
a := "foobar" // ERROR "string `foobar` has 4 occurrences, but such constant `FooBar` already exists"
fmt.Print(a)
b := "foobar"
fmt.Print(b)
c := "foobar"
fmt.Print(c)
fmt.Print("foobar")
}