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

     1  [short] skip
     2  
     3  # Packages in std do not have an install target.
     4  go list -f '{{.Target}}' fmt
     5  ! stdout .
     6  go list -export -f '{{.Export}}' fmt
     7  stdout $GOCACHE
     8  
     9  # With GODEBUG=installgoroot=all, fmt has a target.
    10  # (Though we can't try installing it without modifying goroot).
    11  env GODEBUG=installgoroot=all
    12  go list -f '{{.Target}}' fmt
    13  stdout fmt\.a
    14  
    15  # However, the fake packages "builtin" and "unsafe" do not.
    16  go list -f '{{.Target}}' builtin unsafe
    17  ! stdout .
    18  go install builtin unsafe  # Should succeed as no-ops.
    19  
    20  # With CGO_ENABLED=0, packages that would have
    21  # an install target with cgo on no longer do.
    22  env GODEBUG=
    23  env CGO_ENABLED=0
    24  go list -f '{{.Target}}' runtime/cgo
    25  ! stdout .
    26  go list -export -f '{{.Export}}' runtime/cgo
    27  stdout $GOCACHE
    28  

View as plain text