-
Notifications
You must be signed in to change notification settings - Fork 2.9k
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
Is there an alternative way to init() here? #1335
Comments
This issue is being marked as stale due to a long period of inactivity |
No stale. |
Have a look at #1336 (comment) |
Closing since the larger discussion and alternatives are in the linked issue above. |
The simple pattern of constructor/factory functions may help, it also improves testability, see: |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I'm using this code:
but the linter: https://github.com/leighmcculloch/gochecknoinits in https://golangci-lint.run/usage/linters/ alerts me with:
How to fix this?
Is there an alternative way to
init()
here?The text was updated successfully, but these errors were encountered: