mirror of
https://gitlab.com/pulsechaincom/prysm-pulse.git
synced 2025-01-08 02:31:19 +00:00
6228b3cd9f
* static analyzer with tests * Merge branch 'origin-master' into identical-expression-comparison-analyzer * resolve analyzer errors * Merge branch 'origin-master' into identical-expression-comparison-analyzer * change excluded file in nogo_config * remove tests from bazel file * exclude test file explicitly * extracted common code to helper file * Revert "extracted common code to helper file" This reverts commit e9ccea73604c920451975214d0305e6d16943b3c. * Merge refs/heads/master into identical-expression-comparison-analyzer * Merge refs/heads/master into identical-expression-comparison-analyzer
38 lines
1018 B
Go
38 lines
1018 B
Go
package testdata
|
|
|
|
func Equal() {
|
|
x := []string{"a"}
|
|
if len(x) == len(x) { // want "Boolean expression has identical expressions on both sides. The result is always true."
|
|
}
|
|
}
|
|
|
|
func NotEqual() {
|
|
x := []string{"a"}
|
|
if len(x) != len(x) { // want "Boolean expression has identical expressions on both sides. The result is always true."
|
|
}
|
|
}
|
|
|
|
func GreaterThanOrEqual() {
|
|
x := []string{"a"}
|
|
if len(x) >= len(x) { // want "Boolean expression has identical expressions on both sides. The result is always true."
|
|
}
|
|
}
|
|
|
|
func LessThanOrEqual() {
|
|
x := []string{"a"}
|
|
if len(x) <= len(x) { // want "Boolean expression has identical expressions on both sides. The result is always true."
|
|
}
|
|
}
|
|
|
|
func GreaterThan() {
|
|
x := []string{"a"}
|
|
if len(x) > len(x) { // want "Boolean expression has identical expressions on both sides. The result is always false."
|
|
}
|
|
}
|
|
|
|
func LessThan() {
|
|
x := []string{"a"}
|
|
if len(x) < len(x) { // want "Boolean expression has identical expressions on both sides. The result is always false."
|
|
}
|
|
}
|