Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
G
golang-golang-x-mod
Manage
Activity
Members
Labels
Plan
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Debian Go Packaging Team
packages
golang-golang-x-mod
Commits
8eefc895
Commit
8eefc895
authored
1 year ago
by
Anthony Fok
Browse files
Options
Downloads
Plain Diff
New upstream version 0.16.0
parents
871b7413
766dc5df
No related branches found
Branches containing commit
Tags
upstream/0.16.0
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
modfile/rule.go
+4
-3
4 additions, 3 deletions
modfile/rule.go
with
4 additions
and
3 deletions
modfile/rule.go
+
4
−
3
View file @
8eefc895
...
...
@@ -308,6 +308,7 @@ var laxGoVersionRE = lazyregexp.New(`^v?(([1-9][0-9]*)\.(0|[1-9][0-9]*))([^0-9].
// Toolchains must be named beginning with `go1`,
// like "go1.20.3" or "go1.20.3-gccgo". As a special case, "default" is also permitted.
// TODO(samthanawalla): Replace regex with https://pkg.go.dev/go/version#IsValid in 1.23+
var
ToolchainRE
=
lazyregexp
.
New
(
`^default$|^go1($|\.)`
)
func
(
f
*
File
)
add
(
errs
*
ErrorList
,
block
*
LineBlock
,
line
*
Line
,
verb
string
,
args
[]
string
,
fix
VersionFixer
,
strict
bool
)
{
...
...
@@ -384,7 +385,7 @@ func (f *File) add(errs *ErrorList, block *LineBlock, line *Line, verb string, a
errorf
(
"toolchain directive expects exactly one argument"
)
return
}
else
if
strict
&&
!
ToolchainRE
.
MatchString
(
args
[
0
])
{
errorf
(
"invalid toolchain version '%s': must match format go1.23.0 or
local
"
,
args
[
0
])
errorf
(
"invalid toolchain version '%s': must match format go1.23.0 or
default
"
,
args
[
0
])
return
}
f
.
Toolchain
=
&
Toolchain
{
Syntax
:
line
}
...
...
@@ -630,7 +631,7 @@ func (f *WorkFile) add(errs *ErrorList, line *Line, verb string, args []string,
errorf
(
"go directive expects exactly one argument"
)
return
}
else
if
!
GoVersionRE
.
MatchString
(
args
[
0
])
{
errorf
(
"invalid go version '%s': must match format 1.23"
,
args
[
0
])
errorf
(
"invalid go version '%s': must match format 1.23
.0
"
,
args
[
0
])
return
}
...
...
@@ -646,7 +647,7 @@ func (f *WorkFile) add(errs *ErrorList, line *Line, verb string, args []string,
errorf
(
"toolchain directive expects exactly one argument"
)
return
}
else
if
!
ToolchainRE
.
MatchString
(
args
[
0
])
{
errorf
(
"invalid toolchain version '%s': must match format go1.23 or
local
"
,
args
[
0
])
errorf
(
"invalid toolchain version '%s': must match format go1.23
.0
or
default
"
,
args
[
0
])
return
}
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment