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

     1  # windows executables have the .exe extension and won't overwrite source files
     2  [GOOS:windows] skip
     3  
     4  mkdir out
     5  env GOTMPDIR=$PWD/out
     6  
     7  grep 'this should still exist' foo.go
     8  
     9  ! go build
    10  stderr 'already exists and is not an object file'
    11  
    12  grep 'this should still exist' foo.go
    13  
    14  -- go.mod --
    15  module foo.go
    16  
    17  -- foo.go --
    18  package main // this should still exist
    19  
    20  func main() {}
    21  

View as plain text