-
Notifications
You must be signed in to change notification settings - Fork 17.8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
cmd/go: assume Go 1.16 instead of Go 1.11 for dependencies that lack …
…explicit 'go' directives Fixes #45109 Updates #44976 Updates #36876 Change-Id: Icb00f8b6e0d4e076d82da1697e7058b9e7603916 Reviewed-on: https://go-review.googlesource.com/c/go/+/303229 Trust: Bryan C. Mills <[email protected]> Run-TryBot: Bryan C. Mills <[email protected]> TryBot-Result: Go Bot <[email protected]> Reviewed-by: Jay Conrod <[email protected]>
- Loading branch information
Bryan C. Mills
committed
Mar 19, 2021
1 parent
1c59066
commit 3b0d288
Showing
4 changed files
with
92 additions
and
8 deletions.
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
# Regression test for https://golang.org/issue/45109: | ||
# Dependencies that use post-1.11 Go features should build | ||
# when compiled as vendored dependencies of Go 1.16 modules. | ||
|
||
[short] skip | ||
|
||
go mod init example.com/foo | ||
go mod edit -replace=example.com/[email protected]=./use113 | ||
|
||
go mod vendor | ||
! grep 1.13 vendor/modules.txt # TODO(#36876): record dependency versions. | ||
go build . | ||
|
||
|
||
# In Go 1.16 and earlier, 'go mod vendor' did not record dependency versions. | ||
# That still should not cause a build failure. | ||
|
||
go mod edit -go=1.16 | ||
go mod vendor | ||
! grep 1.13 vendor/modules.txt | ||
go build . | ||
|
||
|
||
-- foo.go -- | ||
package foo | ||
|
||
import _ "example.com/use113" | ||
|
||
-- use113/go.mod -- | ||
module example.com/use113 | ||
|
||
go 1.13 | ||
-- use113/use113.go -- | ||
package use113 | ||
|
||
const x = 1_000 |