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

Should default struct literals be excluded? #23

Closed
HakShak opened this issue Apr 11, 2021 · 1 comment
Closed

Should default struct literals be excluded? #23

HakShak opened this issue Apr 11, 2021 · 1 comment

Comments

@HakShak
Copy link

HakShak commented Apr 11, 2021

var (
   defaultOptions = options{explode:false}
)
@HakShak HakShak changed the title Should default struct initializers be excluded? Should default struct literals be excluded? Apr 11, 2021
@leighmcculloch
Copy link
Owner

leighmcculloch commented Apr 12, 2021

Package vars like the one you demonstrated cause this linter to error because they're a vector to side-effects either when the package modifies the value or an external package does.

I assume you're asking because you're trying to define a package level variable for this.

Instead define a function that returns the value.

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

No branches or pull requests

2 participants