012-arrays

command
v0.0.0-...-e537836 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 23, 2023 License: MIT Imports: 1 Imported by: 0

README

Arrays

The type [n]T is an array of n values of type T. Arrays are mutable.

The expression

var a [10]int

declares a variable a as an array of ten integers and the expression

var z = [...]string{"A", "B", "Z"}

declares and initializes an array of 3 strings with shown values. The ... auto deduces its length.

An array's length is part of its type, so arrays cannot be resized. This seems limiting, but don't worry; Go provides a convenient way of working with arrays...

Documentation

The Go Gopher

There is no documentation for this package.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL