forked from golang/go
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
cmd: fail go mod vendor on case-insensitive import collisions
The existing implementation of go mod vendor allows having case-insensitive imports, which will anyway fail during go build. This improvement validates such collisions during go mod vendor command. Fixes golang#38571
- Loading branch information
1 parent
d7ab277
commit d6b205f
Showing
3 changed files
with
53 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
33 changes: 33 additions & 0 deletions
33
src/cmd/go/testdata/script/mod_vendor_case_insensitive.txt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
# Tests issue #38571 | ||
# Tests that go mod vendor fails on case-insensitive import collision. | ||
|
||
env GO111MODULE=on | ||
|
||
! go mod vendor | ||
stderr 'case-insensitive module path collision' | ||
|
||
-- go.mod -- | ||
module m | ||
|
||
go 1.14 | ||
|
||
require ( | ||
example.com/foo v0.1.0 | ||
example.com/Foo v0.1.0 | ||
) | ||
|
||
replace ( | ||
example.com/foo => ./foo | ||
example.com/Foo => ./!foo | ||
) | ||
-- foo/go.mod -- | ||
module example.com/foo | ||
|
||
-- foo/foo.go -- | ||
package foo | ||
|
||
-- !foo/go.mod -- | ||
module example.com/Foo | ||
|
||
-- !foo/foo.go -- | ||
package Foo |