-
Notifications
You must be signed in to change notification settings - Fork 4
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
fix: type aliases #47
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you, @ldez
Can I ask you to copy-paste your example from issue in new testcase (pkg/analyzer/testdata/src
)? And check change through TDD
Thanks 🙏
The examples come from the test cases of golangci-lint, I thought they were here too. |
They are already inside your repo. ex: nilnil/pkg/analyzer/testdata/src/examples/positive.go Lines 81 to 83 in 1d33958
nilnil/pkg/analyzer/testdata/src/examples/positive_external_types.go Lines 34 to 36 in 1d33958
|
To reproduce:
$ go test ./...
? github.com/Antonboom/nilnil [no test files]
--- FAIL: TestNilNil (0.93s)
analysistest.go:614: examples/positive.go:68: no diagnostic was reported matching "return both a `nil` error and an invalid value: use a sentinel error instead"
analysistest.go:614: examples/positive.go:82: no diagnostic was reported matching "return both a `nil` error and an invalid value: use a sentinel error instead"
analysistest.go:614: examples/positive_external_types.go:35: no diagnostic was reported matching "return both a `nil` error and an invalid value: use a sentinel error instead"
analysistest.go:614: examples/positive_own_types.go:34: no diagnostic was reported matching "return both a `nil` error and an invalid value: use a sentinel error instead"
FAIL
FAIL github.com/Antonboom/nilnil/pkg/analyzer 0.947s
FAIL I tried to set:
with a min Go version 1.22 but this doesn't produce the error. But the env var approach works: $ GODEBUG=gotypesalias=1 go test ./...
? github.com/Antonboom/nilnil [no test files]
--- FAIL: TestNilNil (0.90s)
analysistest.go:614: examples/positive.go:68: no diagnostic was reported matching "return both a `nil` error and an invalid value: use a sentinel error instead"
analysistest.go:614: examples/positive.go:82: no diagnostic was reported matching "return both a `nil` error and an invalid value: use a sentinel error instead"
analysistest.go:614: examples/positive_external_types.go:35: no diagnostic was reported matching "return both a `nil` error and an invalid value: use a sentinel error instead"
analysistest.go:614: examples/positive_own_types.go:34: no diagnostic was reported matching "return both a `nil` error and an invalid value: use a sentinel error instead"
FAIL
FAIL github.com/Antonboom/nilnil/pkg/analyzer 0.917s
FAIL EDIT: I know why the
So the |
Oh, thanks, I completely forgot about it 🤦 |
Fixes #46