slice expression

Writing s[low:high] to get a new slice that views part of an existing slice, array or string.

In more detail

items[:2] gives the first two elements and os.Args[1:] skips the program name. The new slice shares storage with the original, so changing an element through one shows through the other.

Example

args := os.Args[1:]

Related terms

Taught in

References