Slices
s := make([]string, 3) s[0] = "a" s[1] = "b" s = append(s, "d") s = append(s, "e", "f") fmt.Println(s) fmt.Println(s[1]) fmt.Println(len(s)) fmt.Println(s[1:3]) slice := []int{2, 3, 4}
See also: Slices example
Comments
s := make([]string, 3) s[0] = "a" s[1] = "b" s = append(s, "d") s = append(s, "e", "f") fmt.Println(s) fmt.Println(s[1]) fmt.Println(len(s)) fmt.Println(s[1:3]) slice := []int{2, 3, 4}
See also: Slices example