Skip to content

Commit 14fd009

Browse files
authored
Merge pull request ffhelicopter#20 from NHibiki-DEV/master
修改对于 nil 的适用情况
2 parents 84275ec + ecbd5e1 commit 14fd009

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

content/42_03_var.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -166,7 +166,7 @@ func main() {
166166
>编译器会做逃逸分析,所以由Go的编译器决定在哪(堆or栈)分配内存,保证程序的正确性。
167167
168168
## 3.2 零值nil
169-
nil 标志符用于表示interface、函数、maps、slices和channels的“零值”。如果你不指定变量的类型,编译器将无法编译你的代码,因为它猜不出具体的类型。
169+
nil 标志符用于表示interface、函数、maps、slices、channels、error、指针等的“零值”。如果你不指定变量的类型,编译器将无法编译你的代码,因为它猜不出具体的类型。
170170

171171
```Go
172172
package main
@@ -206,4 +206,4 @@ var str string
206206
>本书《Go语言四十二章经》内容在简书同步地址: https://www.jianshu.com/nb/29056963
207207
>
208208
>虽然本书中例子都经过实际运行,但难免出现错误和不足之处,烦请您指出;如有建议也欢迎交流。
209-
>联系邮箱:[email protected]
209+
>联系邮箱:[email protected]

0 commit comments

Comments
 (0)