Our website uses cookies to enhance your browsing experience.
Accept
to the top
>
>
>
V8027. Suspicious sub-expression in...
menu mobile close menu
Additional information
toggle menu Contents

V8027. Suspicious sub-expression in sequence of similar comparisons.

Jun 10 2026

The analyzer has detected a code fragment that most likely contains a typo. A chain of similar structure member comparisons contains an expression that differs from the others. It compares members with different names, while the rest of the chain compares members with the same name.

The example:

func foo(a TestStruct, b TestStruct) interface{} {
  if a.x == b.x && a.y == b.y && a.z == b.y {
    ....
  }
}

In this case, the a.z == b.y expression differs from the other elements in the chain. The error most likely occurred due to a typo made while editing the copied text.

The fixed code:

func foo(a TestStruct, b TestStruct) interface{} {
  if a.x == b.x && a.y == b.y && a.z == b.z {
    ....
  }
}

The analyzer issues a warning whenever the comparison chain has more than two expressions.

This diagnostic is classified as:

Take
a chance!

Take a chance —
spin a wheel.

Prize circle Prize circle Outer ring

Congrats! You've won a 30-day trial license!

You tricked the system, well done! Get a 30-day trial as your prize!