-
Notifications
You must be signed in to change notification settings - Fork 7.4k
Bump Go to 1.25.3 #11926
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
base: trunk
Are you sure you want to change the base?
Bump Go to 1.25.3 #11926
Conversation
Signed-off-by: Babak K. Shandiz <[email protected]>
The `cutSuffix` function was added to backport the functionality of `strings.CutSuffix` from Go 1.20. Now that we're using Go 1.25, we can safely replace our backport with the standard library function. Our backport was an intact copy/paste of the stdlib implementation, so this change does not alter any behavior. Signed-off-by: Babak K. Shandiz <[email protected]>
Signed-off-by: Babak K. Shandiz <[email protected]>
| // Backport strings.CutSuffix from Go 1.20. | ||
| func cutSuffix(s, suffix string) (string, bool) { | ||
| if !strings.HasSuffix(s, suffix) { | ||
| return s, false | ||
| } | ||
| return s[:len(s)-len(suffix)], true | ||
| } |
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.
This was an intact copy/paste of the stdlib implementation (below), so it's safe to just use the stdlib now:
func CutSuffix(s, suffix string) (before string, found bool) {
if !HasSuffix(s, suffix) {
return s, false
}
return s[:len(s)-len(suffix)], true
}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.
Pull Request Overview
This PR upgrades the project's Go version requirement from 1.24 to 1.25 and removes a custom cutSuffix backport function in favor of using the standard library's strings.CutSuffix.
- Upgrades Go version from 1.24 to 1.25 in go.mod
- Replaces custom
cutSuffixfunction withstrings.CutSuffixfrom the standard library - Updates documentation and development environment configurations to reflect the new Go version requirement
Reviewed Changes
Copilot reviewed 6 out of 6 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| internal/ghinstance/host.go | Removes custom cutSuffix backport function and uses strings.CutSuffix |
| go.mod | Updates Go version to 1.25.0 and toolchain to go1.25.3 |
| docs/source.md | Updates documentation to require Go 1.25+ |
| docs/install_source.md | Updates installation instructions to require Go 1.25+ |
| .github/CONTRIBUTING.md | Updates contributor prerequisites to require Go 1.25+ |
| .devcontainer/devcontainer.json | Updates dev container image to use Go 1.25 |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
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.
Actually, I think there are issues with this branch. Govulncheck is failing 🤔
|
Yeah, I've noticed them. Already touched on this in the body:
|
This PR updates Go to the latest stable release.
1.25.01.25.3Other changes:
strings.CutSuffixis now dropped in favour of stdlib implementation.The reported vulnerabilities (e.g. here) are false positives. It's because
govluncheckthinks we're importing the latest untaggedcli/clias an external dependency.