The analyzer has detected a potentially incorrect sequence of characters =+, =-, or =!. It may indicate a typo. To avoid this, use +=, -=, or != respectively.
The example:
var size, delta int
...
size =+ delta
In the fragment, the delta value is assigned to the size variable after the unary plus operator, since the unary plus and assignment operators are bounded. This is most likely a typo, and the intention was to add the value of the delta to size using the += operator.
The fixed code:
var size, delta int
...
size += delta
The code example for which the analyzer will not issue the warning:
size += delta
size = +delta
The diagnostic rule can also detect the typos, including constructs like A =- B and A =! B.
This diagnostic rule is classified as:
Was this page helpful?
Your message has been sent. We will email you at
If you do not see the email in your inbox, please check if it is filtered to one of the following folders: