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

     1  # Tests golang.org/issue/4773
     2  
     3  go list -json example/a
     4  stdout 'case-insensitive import collision'
     5  
     6  ! go build example/a
     7  stderr 'case-insensitive import collision'
     8  
     9  # List files explicitly on command line, to encounter case-checking
    10  # logic even on case-insensitive filesystems.
    11  cp b/file.go b/FILE.go  # no-op on case-insensitive filesystems
    12  ! go list b/file.go b/FILE.go
    13  stderr 'case-insensitive file name collision'
    14  
    15  mkdir a/Pkg  # no-op on case-insensitive filesystems
    16  cp a/pkg/pkg.go a/Pkg/pkg.go  # no-op on case-insensitive filesystems
    17  ! go list example/a/pkg example/a/Pkg
    18  
    19  # Test that the path reported with an indirect import is correct.
    20  cp b/file.go b/FILE.go
    21  [case-sensitive] ! go build example/c
    22  [case-sensitive] stderr '^package example/c\n\timports example/b: case-insensitive file name collision: "FILE.go" and "file.go"$'
    23  
    24  -- go.mod --
    25  module example
    26  
    27  go 1.16
    28  -- a/a.go --
    29  package p
    30  import (
    31  	_ "example/a/pkg"
    32  	_ "example/a/Pkg"
    33  )
    34  -- a/pkg/pkg.go --
    35  package pkg
    36  -- b/file.go --
    37  package b
    38  -- c/c.go --
    39  package c
    40  
    41  import _ "example/b"
    42  

View as plain text