Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
renovate
Manage
Activity
Members
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Model registry
Analyze
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
GitHub Mirror
Renovate Bot
renovate
Commits
ce781fde
Unverified
Commit
ce781fde
authored
7 months ago
by
RahulGautamSingh
Committed by
GitHub
7 months ago
Browse files
Options
Downloads
Patches
Plain Diff
feat(manager/go): support modules without paths (#31155)
parent
7faeec70
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
lib/modules/manager/gomod/line-parser.spec.ts
+22
-0
22 additions, 0 deletions
lib/modules/manager/gomod/line-parser.spec.ts
lib/modules/manager/gomod/line-parser.ts
+1
-1
1 addition, 1 deletion
lib/modules/manager/gomod/line-parser.ts
with
23 additions
and
1 deletion
lib/modules/manager/gomod/line-parser.spec.ts
+
22
−
0
View file @
ce781fde
...
...
@@ -107,6 +107,28 @@ describe('modules/manager/gomod/line-parser', () => {
});
});
it
(
'
should parse go modules without paths - 1
'
,
()
=>
{
const
line
=
'
require tailscale.com v1.72.0
'
;
const
res
=
parseLine
(
line
);
expect
(
res
).
toStrictEqual
({
currentValue
:
'
v1.72.0
'
,
datasource
:
'
go
'
,
depName
:
'
tailscale.com
'
,
depType
:
'
require
'
,
});
});
it
(
'
should parse go modules without paths - 2
'
,
()
=>
{
const
line
=
'
require foo.tailscale.com v1.72.0
'
;
const
res
=
parseLine
(
line
);
expect
(
res
).
toStrictEqual
({
currentValue
:
'
v1.72.0
'
,
datasource
:
'
go
'
,
depName
:
'
foo.tailscale.com
'
,
depType
:
'
require
'
,
});
});
it
(
'
should parse require multi-line definition with quotes
'
,
()
=>
{
const
line
=
'
"foo/foo" v1.2
'
;
const
res
=
parseLine
(
line
);
...
...
This diff is collapsed.
Click to expand it.
lib/modules/manager/gomod/line-parser.ts
+
1
−
1
View file @
ce781fde
...
...
@@ -10,7 +10,7 @@ function trimQuotes(str: string): string {
}
const
requireRegex
=
regEx
(
/^
(?<
keyword>require
)?\s
+
(?<
module>
[^\s]
+
\/[^\s]
+
)\s
+
(?<
version>
[^\s]
+
)(?:\s
*
\/\/\s
*
(?<
comment>
[^\s]
+
)\s
*
)?
$/
,
/^
(?<
keyword>require
)?\s
+
(?<
module>
[^\s]
+
\/
?
[^\s]
+
)\s
+
(?<
version>
[^\s]
+
)(?:\s
*
\/\/\s
*
(?<
comment>
[^\s]
+
)\s
*
)?
$/
,
);
const
replaceRegex
=
regEx
(
...
...
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