...

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

Documentation: cmd/go/testdata/script

     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
     6cd $WORK/a
     7cp issue-original.go issue-expected.go
     8exec go fmt issue-expected.go
     9! cmp -q issue-expected.go issue-original.go
    10
    11# Create that symlink.
    12exec ln -s issue-original.go issue-symlink.go
    13
    14# Now go fmt it.
    15exec go fmt issue-symlink.go
    16
    17# Ensure that the symlinked file is equal to the expected.
    18cmp issue-expected.go issue-symlink.go
    19
    20# Our source code and setup.
    21-- $WORK/a/go.mod --
    22module gofmt_symlink
    23
    24-- $WORK/a/issue-original.go --
    25package main;
    26
    27import "fmt"
    28
    29func main() {
    30       fmt.Println(  "Hello, world!!!"  )
    31}

View as plain text