V8018. Comparison with 'math.NaN()' is meaningless. Use 'math.IsNaN()' function instead.
The analyzer detected a comparison of a float type variable with math.NaN(). Even if the variable has the value math.NaN(), any check of math.NaN() using comparison operators results incorrectly.
Look at the example:
func Foo(a float64) {
if a == math.NaN() {
....
}
}
Checking the variable for NaN using the == operator will always return false. Instead, use the math.IsNaN function.
The fixed code snippet:
func Foo(a float64) {
if math.IsNaN(a) {
....
}
}