package main func main() { s := []uint8{:0} for i := int32(0); i < 100; i++ { s = append(s, uint8(i)) } if len(s) == 100 && s[0] == 0 && s[99] == 99 { println("grow ok") } data := "hello world" sub := data[6:11] if sub == "world" { println("subslice ok") } buf := []uint8{:0} buf = append(buf, 'a') buf = append(buf, 'b') buf = append(buf, 'c') piece := buf[1:3] if piece[0] == 'b' && piece[1] == 'c' && len(piece) == 2 { println("slice piece ok") } }