package main import "fmt" type Node struct{ i int j string } var first = [4]uint8{1,2,3,4} func testb() { var b byte = 1 assert(first[b] == 2) } func ttt() { var a = [3]string{"a", "b", "c"} a[0] = "ccccccccc" i := 0 i += 9 var b [2]int var c [3]Node assert(c[2].i == 0) p := &c[2] p.i = 88 p.j = "haha" assert(c[2].i == 88) assert(c[0].i == 0) var d [3][]int d[1] = make([]int, 2) d[1][1] = 99 fmt.Println(a[0], a[1], a, b, b[:1], a[1:], a[1:][0], c, c[0], d[1][0], d[1][1]) } func main() { ttt() ttt() testb() }