Item #29: typo/wrong operator ? (should be <= instead)

Author: danqzqCreated Jan 29, 2026Updated Jan 29, 2026
Labelscommunity mistake

Describe the mistake

In common mistake 29 "Comparing values incorrectly", the note states:

Line 545 in index.md:

We can also use the `?`, `>=`, `<`, and `>` operators with numeric types to compare values and with strings to compare their lexical order.

The ? operator does not exist in Go. This appears to be a typo for <= (less than or equal), which would complete the standard set of comparison operators alongside >=, < and >.

Solution

Fix the note with correct operator usage:

We can also use the `<=`, `>=`, `<`, and `>` operators with numeric types to compare values and with strings to compare their lexical order.