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

[BUG] False positive when asserting an error pointer #183

Closed
nunnatsa opened this issue Dec 11, 2024 · 1 comment · Fixed by #184
Closed

[BUG] False positive when asserting an error pointer #183

nunnatsa opened this issue Dec 11, 2024 · 1 comment · Fixed by #184
Assignees
Labels
bug Something isn't working

Comments

@nunnatsa
Copy link
Owner

nunnatsa commented Dec 11, 2024

Describe the bug
When asserting a pointer-error with HaveOccurred or Succeed, ginkgolinter detect the value as non error, and triggers a linter error.

To Reproduce

type myErr struct {
    code int
}

func (e *myErr) Error() string {
    ...
}

...
err = &myErr{code: 404}
Expect(err).To(HaveOccured())

Expected behavior
no linter error

Actual behavior
ginkgolinter mistakely detects err as not error type.

Environment:

  • OS: linux
  • Version v0.18.3

Additional context
Originally found here: containernetworking/cni#1148

@nunnatsa nunnatsa added the bug Something isn't working label Dec 11, 2024
@nunnatsa nunnatsa self-assigned this Dec 11, 2024
@nunnatsa
Copy link
Owner Author

Released version with the fix: v0.18.4

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant