SONARGO-126 S1764 Improve RSPEC to cover a check for NaN (#4738)

This commit is contained in:
Peter Trifanov 2025-03-11 14:04:12 +01:00 committed by GitHub
parent d204203515
commit db6114afab
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -2,6 +2,10 @@
include::../description.adoc[]
Note that this rule will raise issues on ``++a == a++`` and ``++a != a++`` expressions which are sometime used to detect ``++NaN++`` values.
It is recommended to use instead https://pkg.go.dev/math#IsNaN[``++math.IsNaN()++``] or an equivalent function.
This will improve code readability.
=== Noncompliant code example
[source,go]