6
Xóa phần tử trong một lát
func main() { a := []string{"Hello1", "Hello2", "Hello3"} fmt.Println(a) // [Hello1 Hello2 Hello3] a = append(a[:0], a[1:]...) fmt.Println(a) // [Hello2 Hello3] } Làm thế nào để xóa thủ thuật với chức năng chắp thêm hoạt động? Có vẻ như nó lấy tất cả mọi thứ trước phần tử đầu tiên …
139
go