...
1
2go env GOBIN
3stdout $WORK${/}gopath${/}bin
4go env -changed GOBIN
5! stdout $WORK
6
7# report explicit settings
8env GOBIN=/tmp/gobin
9go env GOBIN
10stdout /tmp/gobin
11go env -changed GOBIN
12stdout /tmp/gobin
13
14# reset
15env GOBIN=
16go env -changed GOBIN
17! stdout $WORK
18
19# In GOPATH mode
20# the default install directory depends on the GOPATH
21# technically it also depends on the install target
22# but that's not something we can report.
23env GO111MODULE=off
24env GOPATH=$WORK${/}a${:}$WORK${/}b
25
26# report GOPATH[0]/bin outside of GOPATH
27cd $WORK
28go env GOBIN
29stdout $WORK${/}a${/}bin
30
31# report the current GOPATH/bin inside of a GOPATH
32cd $WORK/a/src/example1.com
33go env GOBIN
34stdout $WORK${/}a${/}bin
35
36cd $WORK/b/src/example2.com
37go env GOBIN
38stdout $WORK${/}b${/}bin
39
40-- $WORK/a/src/example1.com/main.go --
41package main
42
43-- $WORK/b/src/example2.com/main.go --
44package main
View as plain text