github.com/gagliardetto/golang-go@v0.0.0-20201020153340-53909ea70814/cmd/go/testdata/script/build_import_comment.txt (about) 1 # TODO: add a go.mod file and test with GO111MODULE explicitly on and off. 2 # We only report the 'expects import' error when modules are disabled. 3 # Do we report comment parse errors or conflicts in module mode? We shouldn't. 4 5 # Import comment matches 6 go build -n works.go 7 8 # Import comment mismatch 9 ! go build -n wrongplace.go 10 stderr 'wrongplace expects import "my/x"' 11 12 # Import comment syntax error 13 ! go build -n bad.go 14 stderr 'cannot parse import comment' 15 16 # Import comment conflict 17 ! go build -n conflict.go 18 stderr 'found import comments' 19 20 -- bad.go -- 21 package p 22 23 import "bad" 24 -- conflict.go -- 25 package p 26 27 import "conflict" 28 -- works.go -- 29 package p 30 31 import _ "works/x" 32 -- wrongplace.go -- 33 package p 34 35 import "wrongplace" 36 -- bad/bad.go -- 37 package bad // import 38 -- conflict/a.go -- 39 package conflict // import "a" 40 -- conflict/b.go -- 41 package conflict /* import "b" */ 42 -- works/x/x.go -- 43 package x // import "works/x" 44 -- works/x/x1.go -- 45 package x // important! not an import comment 46 -- wrongplace/x.go -- 47 package x // import "my/x"