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

treewide: use log/slog instead of golang.org/x/exp/slog #1182

Merged
merged 3 commits into from
Aug 9, 2023

Conversation

rolinh
Copy link
Member

@rolinh rolinh commented Aug 9, 2023

Now that we are using Go v1.21, we can use the log/slog from the standard library instead of the experimental package.

This is a follow-up to #1108

@rolinh rolinh added the release-note/misc This PR makes changes that have no direct user impact. label Aug 9, 2023
@rolinh rolinh requested review from a team as code owners August 9, 2023 10:25
@rolinh rolinh requested review from tklauser and removed request for a team August 9, 2023 10:25
@rolinh
Copy link
Member Author

rolinh commented Aug 9, 2023

The static check failure is due to golangci-lint being built with Go 1.20 and not Go 1.21 meaning it does not understand the new built-ins (min and max notably) that are introduced with this new version and used in the standard library.
I have locally rebuilt golangci-lint with Go v1.21.0 and can confirm that it doesn't complain after that. So I think we have a couple of options:

  • Wait for a golangci-lint release (I'd expect one to happen today or tomorrow)
  • Revert the PR that updated Go to v1.21.0

@tklauser
Copy link
Member

tklauser commented Aug 9, 2023

The static check failure is due to golangci-lint being built with Go 1.20 and not Go 1.21 meaning it does not understand the new built-ins (min and max notably) that are introduced with this new version and used in the standard library. I have locally rebuilt golangci-lint with Go v1.21.0 and can confirm that it doesn't complain after that. So I think we have a couple of options:

  • Wait for a golangci-lint release (I'd expect one to happen today or tomorrow)

I'd prefer this option, given a golangci-lint release will happen later this week. We can still revert the Go 1.21.0 update if the golangci-lint release is delayed for some reason.

@rolinh
Copy link
Member Author

rolinh commented Aug 9, 2023

Nice, v1.54.0 was just released: https://github.com/golangci/golangci-lint/releases/tag/v1.54.0. Let's trigger renovate to pick up the update.

EDIT: I didn't want to wait on the bot and just pushed a commit to update golangci-lint.

Signed-off-by: Robin Hahling <[email protected]>
Signed-off-by: Robin Hahling <[email protected]>
Now that we are using Go v1.21, we can use the `log/slog` from the
standard library instead of the experimental package.

Signed-off-by: Robin Hahling <[email protected]>
@rolinh rolinh requested review from a team as code owners August 9, 2023 12:33
@rolinh rolinh requested review from viktor-kurchenko and removed request for a team August 9, 2023 12:33
Copy link
Member

@tklauser tklauser left a comment

Choose a reason for hiding this comment

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

Neat, thanks!

@tklauser tklauser merged commit 732df5e into main Aug 9, 2023
5 checks passed
@tklauser tklauser deleted the pr/rolinh/stdslog branch August 9, 2023 12:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
release-note/misc This PR makes changes that have no direct user impact.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants