fix: Initialize go empty slice (#947)

* Fix: Initialize go empty slice

* Update list.md

---------

Co-authored-by: Yudong Jin <krahets@163.com>
This commit is contained in:
Neo 2023-11-20 02:08:29 +08:00 committed by GitHub
parent 732750b902
commit 9b35f75505
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

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