func main() {
a := []string{"Hello1", "Hello2", "Hello3"}
fmt.Println(a) // [Hello1 Hello2 Hello3]
a = append(a[:0], a[1:]...)
fmt.Println(a) // [Hello2 Hello3]
}
转载于:https://www.cnblogs.com/shuchengyi/p/11401838.html
func main() {
a := []string{"Hello1", "Hello2", "Hello3"}
fmt.Println(a) // [Hello1 Hello2 Hello3]
a = append(a[:0], a[1:]...)
fmt.Println(a) // [Hello2 Hello3]
}
转载于:https://www.cnblogs.com/shuchengyi/p/11401838.html