Skip to content

Upgrade Golang version v1.24 #1738

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

Merged
merged 5 commits into from
Feb 19, 2025

Conversation

dongjiang1989
Copy link
Contributor

@dongjiang1989 dongjiang1989 commented Feb 17, 2025

This library supports the three most recent major releases of Go. Move golang v1.21

Fix Examples case name:

The new tests analyzer reports common mistakes in declarations of tests, fuzzers, benchmarks, and examples in test packages, such as malformed names, incorrect signatures, or examples that document non-existent identifiers. Some of these mistakes may cause tests not to run. This analyzer is among the subset of analyzers that are run by go test.
by Go 1.24 Release Notes

Signed-off-by: dongjiang <dongjiang1989@126.com>
… examples name

Signed-off-by: dongjiang <dongjiang1989@126.com>
Signed-off-by: dongjiang <dongjiang1989@126.com>
Signed-off-by: dongjiang <dongjiang1989@126.com>
Copy link
Member

@kakkoyun kakkoyun left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the PR. I have some comments.

@@ -1,6 +1,6 @@
module github.com/prometheus/client_golang

go 1.21
go 1.22
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We don't need to bump this if we don't use any new APIs from 1.22.

We officially support only the last three versions but if we don't use new APIs no need to break compatibly.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @kakkoyun
I got it
Revert golang version to 1.21

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Except we do need to change it if we remove 1.21 from the supported version test matrix.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You’re right—I’m still undecided on this. We could continue testing all versions down to the minimum required API level (1.21) since there’s no downside to doing so.

That said, we could also make the case for upgrading the Go toolchain, given its strong backward compatibility.

Better to stick what we have right now.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Except we do need to change it if we remove 1.21 from the supported version test matrix.

Thanks @SuperQ
I got it.

@@ -1,6 +1,6 @@
module github.com/prometheus/client_golang

go 1.21
go 1.22
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You’re right—I’m still undecided on this. We could continue testing all versions down to the minimum required API level (1.21) since there’s no downside to doing so.

That said, we could also make the case for upgrading the Go toolchain, given its strong backward compatibility.

Better to stick what we have right now.

Copy link
Member

@bwplotka bwplotka left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

@bwplotka bwplotka merged commit 2c2903f into prometheus:main Feb 19, 2025
9 checks passed
@dongjiang1989 dongjiang1989 deleted the update-golang124-unittest branch February 19, 2025 10:19
ying-jeanne pushed a commit to ying-jeanne/client_golang that referenced this pull request Mar 28, 2025
* update golang version

Signed-off-by: dongjiang <dongjiang1989@126.com>

* fix the new tests analyzer reports common mistakes in declarations of examples name

Signed-off-by: dongjiang <dongjiang1989@126.com>

* Update .github/workflows/golangci-lint.yml

Signed-off-by: dongjiang <dongjiang1989@126.com>

* update golanglint list

Signed-off-by: dongjiang <dongjiang1989@126.com>

---------

Signed-off-by: dongjiang <dongjiang1989@126.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants