We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
A common idiom in Go is creating empty structs instead of using other constructs, like:
x := Y{}
var x Y
x := &Y{}
x := new(Y)
But this linter complains about that. Could be an option to "ignore empty struct initializations"?
The text was updated successfully, but these errors were encountered:
Hi Bkmeneguello. I'd really love the same feature too! I had a go at putting together a pull request for it if you want to try it out. #118
Sorry, something went wrong.
Have same request, but for returns with signature (T, bool).
Currently linter checks for (T, error) cases and allows empty structs. I think it will be beneficial to add same for (T, bool) signatures:
type DivResult struct { Result int } func Div(a, b int) (X, bool) { if b == 0 { return X{}, false // <-- error here } return X{a / b}, true }
No branches or pull requests
A common idiom in Go is creating empty structs instead of using other constructs, like:
x := Y{}
, instead ofvar x Y
x := &Y{}
, instead ofx := new(Y)
But this linter complains about that. Could be an option to "ignore empty struct initializations"?
The text was updated successfully, but these errors were encountered: