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/go: be less strict about go version syntax in dependency go.mod f…
…iles It is unclear what the future holds for the go line in go.mod files. Perhaps at some point we will switch to semver numbering. Perhaps at some point we will allow specifying minor versions or even betas and release candidates. Those kinds of changes are difficult today because the go line is parsed in dependency modules, meaning that older versions of the Go toolchain need to understand newer go lines. This CL makes that case - parsing a go line in a dependency's go.mod file - a bit more lax about how to find the version. It allows a leading v and any trailing non-digit-prefixed string after the MAJOR.MINOR section. There are no concrete plans to make use of any of these changes, but if in the future we want to make them, having a few Go releases under out belt that will accept the syntax in dependencies will make any changes significantly easier. Change-Id: I79bb84bba4b769048ac4b14d5c275eb9a3f270c4 Reviewed-on: https://go-review.googlesource.com/c/go/+/317690 Trust: Russ Cox <[email protected]> Run-TryBot: Russ Cox <[email protected]> TryBot-Result: Go Bot <[email protected]> Reviewed-by: Bryan C. Mills <[email protected]>
- Loading branch information
Showing
5 changed files
with
66 additions
and
6 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
go get example.net/[email protected] | ||
go get example.net/[email protected] | ||
go get example.net/[email protected] | ||
go get example.net/[email protected] | ||
go get example.net/[email protected] | ||
go get example.net/[email protected] | ||
! go get example.net/[email protected] | ||
stderr 'invalid go version .X.Y.: must match format 1.23' | ||
|
||
-- go.mod -- | ||
module m | ||
|
||
replace ( | ||
example.net/badgo v1.0.0 => ./v1.0.0 | ||
example.net/badgo v1.1.0 => ./v1.1.0 | ||
example.net/badgo v1.2.0 => ./v1.2.0 | ||
example.net/badgo v1.3.0 => ./v1.3.0 | ||
example.net/badgo v1.4.0 => ./v1.4.0 | ||
example.net/badgo v1.5.0 => ./v1.5.0 | ||
example.net/badgo v1.6.0 => ./v1.6.0 | ||
) | ||
|
||
-- v1.0.0/go.mod -- | ||
module example.net/badgo | ||
go 1.17.0 | ||
|
||
-- v1.1.0/go.mod -- | ||
module example.net/badgo | ||
go 1.17rc2 | ||
|
||
-- v1.2.0/go.mod -- | ||
module example.net/badgo | ||
go 1.17.1 | ||
|
||
-- v1.3.0/go.mod -- | ||
module example.net/badgo | ||
go v1.17.0 | ||
|
||
-- v1.4.0/go.mod -- | ||
module example.net/badgo | ||
go v1.17.0-rc.2 | ||
|
||
-- v1.5.0/go.mod -- | ||
module example.net/badgo | ||
go v1.17.1 | ||
|
||
-- v1.6.0/go.mod -- | ||
module example.net/badgo | ||
go X.Y | ||
|
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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