mirror of
https://github.com/krahets/hello-algo.git
synced 2024-12-24 09:26:28 +08:00
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:
parent
732750b902
commit
9b35f75505
1 changed files with 1 additions and 1 deletions
|
@ -65,7 +65,7 @@
|
|||
```go title="list_test.go"
|
||||
/* 初始化列表 */
|
||||
// 无初始值
|
||||
nums1 := []int
|
||||
nums1 := []int{}
|
||||
// 有初始值
|
||||
nums := []int{1, 3, 2, 5, 4}
|
||||
```
|
||||
|
|
Loading…
Reference in a new issue