When code has already dealt with a variable being nil, it doesn't usually make sense to continue referencing that variable. e.g.
func foo() error {
result, err := DoSomething()
if err != nil {
return err
}
if result.IsBad() {
return err
}
return nil
}
go get github.com/devnev/go-lint-ref-after-nil-check
go-lint-ref-after-nil-check source_file.go source_dir
This has not been tested on a real codebase yet.