fix: Initialize go empty slice (#947)

* Fix: Initialize go empty slice

* Update list.md

---------

Co-authored-by: Yudong Jin <krahets@163.com>
pull/961/head
Neo 1 year ago committed by GitHub
parent 732750b902
commit 9b35f75505
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -65,7 +65,7 @@
```go title="list_test.go" ```go title="list_test.go"
/* 初始化列表 */ /* 初始化列表 */
// 无初始值 // 无初始值
nums1 := []int nums1 := []int{}
// 有初始值 // 有初始值
nums := []int{1, 3, 2, 5, 4} nums := []int{1, 3, 2, 5, 4}
``` ```

Loading…
Cancel
Save