-
Notifications
You must be signed in to change notification settings - Fork 11
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 exception for template.Must #33
Comments
@leighmcculloch I can also do the PR if you agree that it is a good idea. |
I'm on the fence on this one. I have seen this be a somewhat common pattern to store these values in global variables, but it continues to perpetuate the idea of using global variables. I don't use templates a whole lot myself though, are there ways that aren't obtuse to using them without globals? |
Not sure I understand what you mean. There are always ways around it, but they would be |
Hello,
First, thank you for providing this linter! I am using it as part of
golangci-lint
. I am now working on a project that have someregex.Must
in global variables and have noticed that these are excluded from linter when used as global variables.I assume that is because they are in this case compile-time errors if something goes wrong.
Now I also need to do same thing with templates for policy documents which are part of HTTP request body. Template documents are defined as
const
s and in global variable I am doing following:which if anything is wrong with
AdminPolicy
template document orReaderPolicy
template document are compiler-ime errors, same as for regex. Therefore I think it would be nice to have same exception for template.Must as we have forregex.Must
.The text was updated successfully, but these errors were encountered: