Skip to content

Update to support golangci-lint v2 #366

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 1 commit into from
Apr 7, 2025
Merged

Update to support golangci-lint v2 #366

merged 1 commit into from
Apr 7, 2025

Conversation

thockin
Copy link
Contributor

@thockin thockin commented Apr 5, 2025

No description provided.

@@ -41,17 +41,17 @@ type stdoutlogger struct {
}

func (l stdoutlogger) WithName(name string) logr.LogSink {
l.Formatter.AddName(name)
l.AddName(name)
Copy link
Contributor

Choose a reason for hiding this comment

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

Is this something that we might want to enable as hint in Kubernetes? Or is it too subjective?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

It's CORRECT but not obviously BETTER, IMO. I decided not to fight it here.

Copy link
Contributor

Choose a reason for hiding this comment

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

Agreed.

@@ -32,42 +32,42 @@ import (
//

func BenchmarkSlogSinkLogInfoOneArg(b *testing.B) {
var log logr.Logger = logr.FromSlogHandler(logr.ToSlogHandler(logr.Discard()))
var log logr.Logger = logr.FromSlogHandler(logr.ToSlogHandler(logr.Discard())) //nolint:staticcheck
Copy link
Contributor

Choose a reason for hiding this comment

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

Any reason to keep the var log logr.Logger = instead of replacing with log :=?

I don't remember why I wrote it like this other than more clearly showing the type.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I like the clarity in the benchmark.

Copy link
Contributor

Choose a reason for hiding this comment

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

Probably that was why I did it - if only I remembered... 😅

@pohly pohly merged commit 158c311 into go-logr:master Apr 7, 2025
23 checks passed
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

2 participants