Quick actions

cmd+k|ctrl+k

Navigation

Languages

Basic types / Arrays / Essential Go

Snippet info

Language

Go

Visibility

public

Author

kkowalczyk

Created

2019-03-26T10:02:47Z

Updated

2019-03-26T10:02:47Z

// :glot,
package main

import "fmt"

func main() {
	var a1 = [2]byte{3, 8} // array of 2 bytes
	// when using [...] size will be deduced from { ... }
	a2 := [...]int{1, 2, 3} // array of 3 integers

	fmt.Printf("Size of a1: %d.\nSize of a2: %d\n", len(a1), len(a2))
}
INFO