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
* Enable ginkgolinter and fix findings
ginkgolinter finds bugs and enforces standards of using the ginkgo and
gomega packages. See more details here:
https://github.com/nunnatsa/ginkgolinter
This PR enables the ginkgolinter in the .golangci.yml, and fixes all the
new finding from running golangci-lint.
Note: all the finding were auto fixed by running the ginkgolinter cli
with the `-fix` flag.
Signed-off-by: Nahshon Unna-Tsameret <nunnatsa@redhat.com>
* Fix the assertMetrics test helper function
The assertMetrics function in
handler/instrumented_enqueue_object_test.go, wasn't really doing
anything. The switch-case compared a pointer value to another pointer,
so the no case was actually ever selected, because the addresses were
not the same.
Tested with a debugger - no value were ever selected.
This commit fixes this test by selecting the value rather than the
address.
Signed-off-by: Nahshon Unna-Tsameret <nunnatsa@redhat.com>
* Simplify error check in tests
Replace this patter:
```golang
err := someFuncRetOnlyErr()
Expect(err).ToNot(HaveOccurred()
```
With
```golang
Expect(someFuncRetOnlyErr()).To(Succeed())
```
Also, use the `MatchError` gomega matcher when checking errors.
Signed-off-by: Nahshon Unna-Tsameret <nunnatsa@redhat.com>
---------
Signed-off-by: Nahshon Unna-Tsameret <nunnatsa@redhat.com>
0 commit comments