github.com/songshiyun/revive@v1.1.5-0.20220323112655-f8433a19b3c5/testdata/import-shadowing.go (about) 1 package fixtures 2 3 import ( 4 ast "go/ast" 5 "bytes" 6 "crypto/md5" 7 "fmt" 8 _ "net/http" 9 "strings" 10 str "strings" 11 "fixtures" // Test case for issue #534 12 ) 13 14 const str = "" // MATCH /The name 'str' shadows an import name/ 15 16 type myAst struct { 17 ast *ast.GenDecl 18 } 19 20 type bytes struct {} // MATCH /The name 'bytes' shadows an import name/ 21 22 type fmt interface {} // MATCH /The name 'fmt' shadows an import name/ 23 24 func (ast myAst) foo() {} // MATCH /The name 'ast' shadows an import name/ 25 26 func md5() {} // MATCH /The name 'md5' shadows an import name/ 27 28 func bar(_ string) {} 29 30 func toto() { 31 strings := map[string]string{} // MATCH /The name 'strings' shadows an import name/ 32 } 33 34 func titi() { 35 v := md5+bytes 36 return ast 37 }