fixed clear list in Go

This commit is contained in:
machangxin
2022-12-18 21:57:29 +08:00
parent 71c3ed70a4
commit 4fa41ce08a
2 changed files with 2 additions and 2 deletions

View File

@@ -208,7 +208,7 @@ comments: true
```go title="list_test.go"
/* 清空列表 */
list = []int{}
list = nil
/* 尾部添加元素 */
list = append(list, 1)