func main() { a := []string{"Hello1", "Hello2", "Hello3"} fmt.Println(a) // [Hello1 Hello2 Hello3] a = append(a[:0], a[1:]...) fmt.Println(a) // [Hello2 Hello3] }
golang中删除切片中的元素
原文:https://www.cnblogs.com/shuchengyi/p/11401838.html