Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(gomod): use latest go version when binarySource=docker #9764

Merged
merged 1 commit into from Apr 28, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 1 addition & 1 deletion lib/manager/gomod/__snapshots__/extract.spec.ts.snap
Expand Up @@ -3,7 +3,7 @@
exports[`manager/gomod/extract extractPackageFile() extracts constraints 1`] = `
Object {
"constraints": Object {
"go": "1.13",
"go": "^1.13",
},
"deps": Array [
Object {
Expand Down
2 changes: 1 addition & 1 deletion lib/manager/gomod/extract.spec.ts
Expand Up @@ -21,7 +21,7 @@ describe(getName(__filename), () => {
it('extracts constraints', () => {
const res = extractPackageFile(gomod3);
expect(res).toMatchSnapshot();
expect(res.constraints.go).toEqual('1.13');
expect(res.constraints.go).toEqual('^1.13');
});
it('extracts multi-line requires', () => {
const res = extractPackageFile(gomod2).deps;
Expand Down
2 changes: 1 addition & 1 deletion lib/manager/gomod/extract.ts
Expand Up @@ -43,7 +43,7 @@ export function extractPackageFile(content: string): PackageFile | null {
for (let lineNumber = 0; lineNumber < lines.length; lineNumber += 1) {
let line = lines[lineNumber];
if (line.startsWith('go ') && validRange(line.replace('go ', ''))) {
constraints.go = line.replace('go ', '');
constraints.go = line.replace('go ', '^');
}
const replaceMatch = /^replace\s+[^\s]+[\s]+[=][>]\s+([^\s]+)\s+([^\s]+)/.exec(
line
Expand Down