nunnatsa / ginkgolinter

golang linter for ginkgo and gomega
MIT License
24 stars 6 forks source link

Fix bug with comparison and pointers #66

Closed nunnatsa closed 1 year ago

nunnatsa commented 1 year ago

Description

When comapring two pointrs like this: Expect(p1 != p2).To(BeTrue())

For go, it means comparing the addresses. The linter changes this to

Expect(p1).ToNot(Equal(p2)).

But in this case gomega compares the values pointed by the pointers.

This PR fixes this issue by using the BeIdenticalTo matcher in case of pointers coparison.

Type of change

Please delete options that are not relevant.

How Has This Been Tested?

Checklist:

@nunnatsa

coveralls commented 1 year ago

Pull Request Test Coverage Report for Build 4283956628


Totals Coverage Status
Change from base Build 4280731613: 0.1%
Covered Lines: 641
Relevant Lines: 739

💛 - Coveralls