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

Add an option to disallow the usage of default logger #30

Closed
AlekSi opened this issue Mar 5, 2024 · 3 comments · Fixed by #32
Closed

Add an option to disallow the usage of default logger #30

AlekSi opened this issue Mar 5, 2024 · 3 comments · Fixed by #32

Comments

@AlekSi
Copy link

AlekSi commented Mar 5, 2024

So, for example, slog.Info would be forbidden, but l := slog.New(…); l.Info would be allowed.

@tmzane
Copy link
Member

tmzane commented Mar 6, 2024

Good idea!

I think disallowing global loggers in general might be a useful option, so we could implement it as something like no-global: all (forbid global loggers) and no-global: default (forbid the default logger). WDYT?

@AlekSi
Copy link
Author

AlekSi commented Mar 6, 2024

Sounds great!

@tmzane
Copy link
Member

tmzane commented Mar 17, 2024

@AlekSi Implemented as discussed. Will probably land in the next golangci-lint release 👀

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 a pull request may close this issue.

2 participants