You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
package p
import "fmt"
func main() {
fmt.Println("Hello, world");
}
go tool compile foo.go
go tool link foo.go
/home/iant/go/pkg/tool/linux_amd64/link: foo.o: not package main (package p)
go tool compile -pack foo.go
go tool link foo.a
./a.out
Hello, world
The link should not succeed in the -pack case. It should get the same error as the non-pack case.
The text was updated successfully, but these errors were encountered:
Go 1.6 fixed a bug where compiling with the -pack flag allowed non-main
packages to link.
golang/go#13468
This change uses package main for choosestage and gotestmain.
foo.go:
The link should not succeed in the -pack case. It should get the same error as the non-pack case.
The text was updated successfully, but these errors were encountered: