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

     1  # Test that gofmt-ing a symlink works correctly. See #79735.
     2  
     3  # Skip on systems without unix-style symlinks
     4  [GOOS:windows] skip
     5  
     6  cd $WORK/a
     7  cp issue-original.go issue-expected.go
     8  exec go fmt issue-expected.go
     9  ! cmp -q issue-expected.go issue-original.go
    10  
    11  # Create that symlink.
    12  exec ln -s issue-original.go issue-symlink.go
    13  
    14  # Now go fmt it.
    15  exec go fmt issue-symlink.go
    16  
    17  # Ensure that the symlinked file is equal to the expected.
    18  cmp issue-expected.go issue-symlink.go
    19  
    20  # Our source code and setup.
    21  -- $WORK/a/go.mod --
    22  module gofmt_symlink
    23  
    24  -- $WORK/a/issue-original.go --
    25  package main;
    26  
    27  import "fmt"
    28  
    29  func main() {
    30         fmt.Println(  "Hello, world!!!"  )
    31  }
    32  

View as plain text