-
Notifications
You must be signed in to change notification settings - Fork 2.4k
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(go): Remove deprecated '-d' flag when doing 'go get' #32506
base: main
Are you sure you want to change the base?
Conversation
Ah I see we're using older versions of Go elsewhere, maybe we should update those at the same time 🤔 |
Usually Renovate will use the latest Go version, but users may pin to an older version. Therefore we ideally would look at the go.mod directive and decide on -d based on the version in use |
@@ -243,7 +243,7 @@ export async function updateArtifacts({ | |||
} | |||
} | |||
|
|||
let args = `get -d -t ${goGetDirs ?? './...'}`; | |||
let args = `get -t ${goGetDirs ?? './...'}`; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
extract go version from go
and / or toolchain
directive. drop -d
only if it is >=1.18
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry was just about to comment: I made an update to update Go version after I realised it was currently older: #32514
Thanks for the response, I wouldn't have guessed anyone is on an older version, given Go's release policy of only officially support the latest two major versions, i.e. 1.23 and 1.22 at the moment. It also means you can barely upgrade to any libraries at all if you're on < 1.18, so I wouldn't have thought it would be feasible to do this and run Renovate! |
🤔 go v1.17 was realesed ~3 years ago. https://go.dev/blog/go1.17 https://github.com/search?q=%22go+1.17%22++NOT+is%3Aarchived+path%3Ago.mod&type=code It seems there are some repos with go v1.17. @secustor @rarkins Can we really assume someone uses go <1.18 and also is using renovate? I think @echarrod is right and we can assume any update needs a newer go version now. |
Go is a little bit unique though because even if a repo has a go mod directive of 1.17, this means "Use Go 1.17 compatibility" and not "Use Go 1.17". i.e. it's not like a .nvmrc file. So Renovate intentionally runs the latest 1.x Go no matter what the Go mod directive says, because Go is backwards compatible. The only way removing this flag could cause problems is if a user pinned to an older exact version using |
Can we detect if someone has pinned their go constraints, or should we assume they won't? |
we can detect |
Hey all 👋
|
yes, as told before |
Changes
-d
flag from go get.Context
Documentation (please check one with an [x])
How I've tested my work (please select one)
I have verified these changes via: