mirror of
https://github.com/gopl-zh/gopl-zh.github.com.git
synced 2025-08-04 23:02:44 +00:00
fix errata
This commit is contained in:
@@ -14,7 +14,7 @@
|
||||
fmt.Println(f(3)) // "-3"
|
||||
fmt.Printf("%T\n", f) // "func(int) int"
|
||||
|
||||
f = product // 編譯錯誤: can't assign f(int, int) int to f(int) int
|
||||
f = product // compile error: can't assign func(int, int) int to func(int) int
|
||||
```
|
||||
|
||||
函數類型的零值是nil。調用值爲nil的函數值會引起panic錯誤:
|
||||
|
Reference in New Issue
Block a user