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

     1  env GO111MODULE=off
     2  [short] skip # rebuilds std for alternate architecture
     3  
     4  cd mycmd
     5  go build mycmd
     6  
     7  # cross-compile install with implicit GOBIN=$GOPATH/bin can make subdirectory
     8  env GOARCH=386
     9  [386] env GOARCH=amd64
    10  env GOOS=linux
    11  go install mycmd
    12  exists $GOPATH/bin/linux_$GOARCH/mycmd
    13  
    14  # cross-compile install with explicit GOBIN cannot make subdirectory
    15  env 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.
    20  go list -f '{{.Target}}'  cmd/pack
    21  stdout ${GOROOT}[/\\]pkg[/\\]tool[/\\]${GOOS}_${GOARCH}[/\\]pack$
    22  
    23  -- mycmd/x.go --
    24  package main
    25  func main() {}
    26  

View as plain text