1
0
mirror of https://github.com/mgechev/revive.git synced 2025-11-29 22:28:23 +02:00

Incorrect handling of token.{LEQ,GEQ} for constant-logical-expr (#642)

* fix: incorrect handling of token.{LEQ,GEQ} for constant-logical-expr lint

Signed-off-by: subham sarkar <sarkar.subhams2@gmail.com>

* tiny modification in comments

Co-authored-by: chavacava <salvadorcavadini+github@gmail.com>
This commit is contained in:
subham sarkar
2022-02-27 14:07:51 +05:30
committed by GitHub
parent d4fbc92440
commit 54d9a09ab5
2 changed files with 19 additions and 5 deletions

View File

@@ -1,5 +1,7 @@
package fixtures
import "fmt"
// from github.com/ugorji/go/codec/helper.go
func isNaN(f float64) bool { return f != f } // MATCH /expression always evaluates to false/
@@ -9,9 +11,9 @@ func foo1(f float64) bool { return foo2(2.) > foo2(2.) } // MATCH /expression al
func foo2(f float64) bool { return f < f } // MATCH /expression always evaluates to false/
func foo3(f float64) bool { return f <= f } // MATCH /expression always evaluates to false/
func foo3(f float64) bool { return f <= f } // MATCH /expression always evaluates to true/
func foo4(f float64) bool { return f >= f } // MATCH /expression always evaluates to false/
func foo4(f float64) bool { return f >= f } // MATCH /expression always evaluates to true/
func foo5(f float64) bool { return f == f } // MATCH /expression always evaluates to true/