...
1env GO111MODULE=off
2[short] skip # rebuilds std for alternate architecture
3
4cd mycmd
5go build mycmd
6
7# cross-compile install with implicit GOBIN=$GOPATH/bin can make subdirectory
8env GOARCH=386
9[GOARCH:386] env GOARCH=amd64
10env GOOS=linux
11go install mycmd
12exists $GOPATH/bin/linux_$GOARCH/mycmd
13
14# cross-compile install with explicit GOBIN cannot make subdirectory
15env GOBIN=$WORK/bin
16! go install mycmd
17! exists $GOBIN/linux_$GOARCH
18
19# The install directory for a cross-compiled standard command should include GOARCH.
20go list -f '{{.Target}}' cmd/pack
21stdout ${GOROOT}[/\\]pkg[/\\]tool[/\\]${GOOS}_${GOARCH}[/\\]pack$
22
23-- mycmd/x.go --
24package main
25func main() {}
View as plain text