NOTE

Go Arrays

Fixed-length value types, copying semantics, indexing, iteration, and their relationship to slices.

GoCreated Updated 1 min readhistorical

This is a historical learning note and may contain outdated or incomplete understanding.

A Go array has a length that is part of its type: [3]int and [4]int are different types. Arrays are value types, so assignment and parameter passing copy the array value unless a pointer is used.

Slices are the normal variable-length view over array storage. Use arrays when fixed size is semantically important or for low-level representation; most collection APIs should expose slices.

Loading helpful count