Text file src/cmd/go/testdata/script/env_gobin.txt

     1  
     2  go env GOBIN
     3  stdout $WORK${/}gopath${/}bin
     4  go env -changed GOBIN
     5  ! stdout $WORK
     6  
     7  # report explicit settings
     8  env GOBIN=/tmp/gobin
     9  go env GOBIN
    10  stdout /tmp/gobin
    11  go env -changed GOBIN
    12  stdout /tmp/gobin
    13  
    14  # reset
    15  env GOBIN=
    16  go 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.
    23  env GO111MODULE=off
    24  env GOPATH=$WORK${/}a${:}$WORK${/}b
    25  
    26  # report GOPATH[0]/bin outside of GOPATH
    27  cd $WORK
    28  go env GOBIN
    29  stdout $WORK${/}a${/}bin
    30  
    31  # report the current GOPATH/bin inside of a GOPATH
    32  cd $WORK/a/src/example1.com
    33  go env GOBIN
    34  stdout $WORK${/}a${/}bin
    35  
    36  cd $WORK/b/src/example2.com
    37  go env GOBIN
    38  stdout $WORK${/}b${/}bin
    39  
    40  -- $WORK/a/src/example1.com/main.go --
    41  package main
    42  
    43  -- $WORK/b/src/example2.com/main.go --
    44  package main
    45  

View as plain text