You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
On Fri, Jun 17, 2022, 11:52 Danut Avadanei ***@***.***> wrote:
ineffassign version: last version available
go version: go version go1.18.3
Running the linter when interacting with a var after passing it to a
deferred function call marks it as ineffectual assignment
package main
import "errors"
func shutdown(err error) {
if err != nil {
panic(err)
}
}
func TestLint() {
var err error
defer shutdown(err)
if true {
err = errors.New("new error message") // test.go:16:9: ineffectual assignment to err
}
}
Expectation: should not reported.
Output
ineffassign ./...
go-lint-issue/cmd/test.go:16:9: ineffectual assignment to err
—
Reply to this email directly, view it on GitHub
<#71>, or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAMP7UATJ36VZX4ZDT54NSDVPRDE3ANCNFSM5ZBXP5SQ>
.
You are receiving this because you are subscribed to this thread.Message
ID: ***@***.***>
ineffassign version: last version available
go version: go version go1.18.3
Running the linter when interacting with a var after passing it to a deferred function call marks it as
ineffectual assignment
Expectation: should not reported.
Output
The text was updated successfully, but these errors were encountered: