github.com/gagliardetto/golang-go@v0.0.0-20201020153340-53909ea70814/cmd/go/testdata/script/build_exe.txt (about) 1 # go build with -o and -buildmode=exe should on a non-main package should throw an error 2 3 ! go build -buildmode=exe -o out$GOEXE not_main 4 stderr '-buildmode=exe requires exactly one main package' 5 ! exists out$GOEXE 6 ! go build -buildmode=exe -o out$GOEXE main_one main_two 7 stderr '-buildmode=exe requires exactly one main package' 8 ! exists out$GOEXE 9 10 -- not_main/not_main.go -- 11 package not_main 12 13 func F() {} 14 -- main_one/main_one.go -- 15 package main 16 17 func main() {} 18 -- main_two/main_two.go -- 19 package main 20 21 func main() {}