package main import ( "fmt" ) func main() { s := make([]string,10) fmt.Println(s) fmt.Println(len(s)) fmt.Println("--------------------------") s = append(s,"a") s = append(s,"a","b") fmt.Println(len(s)) fmt.Println(s[10:13]) fmt.Println("--------------------------") s[0] = "c" s[1] = "b" fmt.Println(len(s)) fmt.Println(s) fmt.Println("--------------------------") fmt.Println(s[:13]) fmt.Println(s[1:13]) fmt.Println("--------------------------") } @H_404_1@输出:
原文链接:https://www.f2er.com/go/190341.html