Neglecting integer overflows (#18)
Official 100go entry on treating integer overflow as a real correctness concern in counters, sizes, and arithmetic.
Official 100go entry on treating integer overflow as a real correctness concern in counters, sizes, and arithmetic.
- Author: Teiva Harsanyi
- Authority: community
- Kind: guide
- URL: https://100go.co/#neglecting-integer-overflows-18
What it covers
- overflow-prone arithmetic
- checks before math
- size and capacity calculations
Why authoritative
Official 100go website entry for this specific mistake.
Use when
- could this arithmetic overflow in Go
- how should I guard integer math in Go
- is this size calculation safe
Keywords
- integer overflow, arithmetic, bounds, sizes, counters