স্লাইসেস
s := make([]string, 3)
fmt.Println("emp:", s)emp: [ ]fmt.Println("set:", s)
s[0] = "a"
s[1] = "b"
s[2] = "c"
fmt.Println("get:", s[2])set: [ ]
get: cfmt.Println("len:", len(s))Last updated
len: 3s = append(s, "d")
s = append(s, "e", "f")
fmt.Println("apd:", s)apd: [a b c d e f]c := make([]string, len(s))
copy(c, s)
fmt.Println("cpy:", c)cpy: [a b c d e f]l := s[2:5]
fmt.Println("sl1:", l)sl1: [c d e]l = s[:5]
fmt.Println("sl2:", l)sl2: [a b c d e]l = s[2:]
fmt.Println("sl3:", l)sl3: [c d e f]t := []string{"g", "h", "i"}
fmt.Println("dcl:", t)dcl: [g h i]