diff --git a/go.mod b/go.mod index 342cafb7498d3..005ca34afad9f 100644 --- a/go.mod +++ b/go.mod @@ -10,7 +10,7 @@ require ( github.com/Djarvur/go-err113 v0.0.0-20210108212216-aea10b59be24 github.com/OpenPeeDeeP/depguard v1.1.0 github.com/alexkohler/prealloc v1.0.0 - github.com/ashanbrown/forbidigo v1.2.0 + github.com/ashanbrown/forbidigo v1.3.0 github.com/ashanbrown/makezero v0.0.0-20210520155254-b6261585ddde github.com/bkielbasa/cyclop v1.2.0 github.com/blizzy78/varnamelen v0.5.0 diff --git a/go.sum b/go.sum index f244ce258d9dc..f009b2a97fdb9 100644 --- a/go.sum +++ b/go.sum @@ -93,6 +93,8 @@ github.com/armon/go-radix v0.0.0-20180808171621-7fddfc383310/go.mod h1:ufUuZ+zHj github.com/armon/go-radix v1.0.0/go.mod h1:ufUuZ+zHj4x4TnLV4JWEpy2hxWSpsRywHrMgIH9cCH8= github.com/ashanbrown/forbidigo v1.2.0 h1:RMlEFupPCxQ1IogYOQUnIQwGEUGK8g5vAPMRyJoSxbc= github.com/ashanbrown/forbidigo v1.2.0/go.mod h1:vVW7PEdqEFqapJe95xHkTfB1+XvZXBFg8t0sG2FIxmI= +github.com/ashanbrown/forbidigo v1.3.0 h1:VkYIwb/xxdireGAdJNZoo24O4lmnEWkactplBlWTShc= +github.com/ashanbrown/forbidigo v1.3.0/go.mod h1:vVW7PEdqEFqapJe95xHkTfB1+XvZXBFg8t0sG2FIxmI= github.com/ashanbrown/makezero v0.0.0-20210520155254-b6261585ddde h1:YOsoVXsZQPA9aOTy1g0lAJv5VzZUvwQuZqug8XPeqfM= github.com/ashanbrown/makezero v0.0.0-20210520155254-b6261585ddde/go.mod h1:oG9Dnez7/ESBqc4EdrdNlryeo7d0KcW1ftXHm7nU/UU= github.com/aws/aws-sdk-go v1.23.20/go.mod h1:KmX6BPdI08NWTb3/sm4ZGu5ShLoqVDhKgpiN924inxo= diff --git a/test/testdata/configs/forbidigo.yml b/test/testdata/configs/forbidigo.yml index 561e46d53cc47..11efcefad8599 100644 --- a/test/testdata/configs/forbidigo.yml +++ b/test/testdata/configs/forbidigo.yml @@ -2,3 +2,4 @@ linters-settings: forbidigo: forbid: - fmt\.Print.* + - time.Sleep(# no sleeping!)? diff --git a/test/testdata/forbidigo_example.go b/test/testdata/forbidigo_example.go index 5ac04676b7958..3e7c3b95040a3 100644 --- a/test/testdata/forbidigo_example.go +++ b/test/testdata/forbidigo_example.go @@ -2,8 +2,12 @@ //config_path: testdata/configs/forbidigo.yml package testdata -import "fmt" +import ( + "fmt" + "time" +) func Forbidigo() { - fmt.Printf("too noisy!!!") // ERROR "use of `fmt\\.Printf` forbidden by pattern `fmt\\\\.Print\\.\\*`" + fmt.Printf("too noisy!!!") // ERROR "use of `fmt\\.Printf` forbidden by pattern `fmt\\\\.Print\\.\\*`" + time.Sleep(time.Nanosecond) // ERROR "no sleeping!" }