-
Notifications
You must be signed in to change notification settings - Fork 5.6k
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
Linter: revive, Rule: max-public-structs
- Warns on files declaring too many public structs. Should we enable it?
#15822
Comments
If we could limit the linter to |
I'm split on this... on the one hand I can understand where it could be poorly written code, but on the other hand, some plugins have a lot of data to handle, like |
@DStrand1 I think most of those declarations can be internal as well! Unmarshalling JSON also works for non-exported structures, it's just the struct-fields that need to be "public"... Where do you see issues? Could you point to a concrete example? |
I'm also wondering why plugins should be allowed up to 5 exported structs? They all should only have 1? (the plugin itself) |
There might be an interface to mock the test... |
But that doesn't need to be exported? |
Well you might want to run tests in a separate package like
for various reasons and need to be able to fulfill the interface... |
Description
This issue starts a discussion about enabling:
This rule warns on files declaring more than a configured, maximum number of public structs.
Configuration:
(int) the maximum allowed public structs
Example configuration:
Expected output
Decision about enabling or not enabling this rule.
Findings
For this rule (with above configuration), the following findings were found in the current codebase:
The text was updated successfully, but these errors were encountered: