-
Notifications
You must be signed in to change notification settings - Fork 8
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
Check if log message is constant #17
Comments
Replying to #13 (comment) and #13 (comment)
I think "message should be a constant value" is a much better description of what I should be looking for. And you're right to point out that doing |
Well, we already do a similar thing, take a look at the
I think both Also, this check looks like a good default to me (just like |
That sounds good to me. I did recently come across a case where a team I work with tried very hard to make the case that not all variables made sense as attributes if it hurt readability. Their example was having a message like "failed to connect to database, sleeping for %d seconds". I'm not sure the example is legitimate for a few reasons, but having the ability to disable it globally and/or suppress the linter in golangci-lint should suffice if there's a significant disagreement in the approach. |
Good example! There will be exceptions, totally. The problem is, if we made it a flag, like the other options, it'd be global on / global off. Which is not really convenient to deal with a few exceptions. |
I'm going to search for |
I think it's a case of whether the suppressions outweigh the unsuppressed lint rules. Given how new slog is, we may not fully understand how it gets used in the while for some months, particularly as logging tends to be hard to replace in many established applications. If you're willing to be opinionated and your search is not overwhelmingly in the opposite direction, I'd say having this as default is fine.
Nothing yet, but I'll keep an eye out for them. |
Agree, we definitely need more data. Let's make it optional then, and if it's useful enough, we can make it a default in the future. Would you like to work on the implementation? :) |
Sure, I'll take a go at it over the weekend. |
See #13 for the start of the discussion.
@mattdowdell, let's continue here :)
The text was updated successfully, but these errors were encountered: