函数的零值
Zero value for funcs
给定一个结构:
type foo struct {
bar func(int) int
}
当我var x foo
x.bar
的初始值是多少?
来自 the documentation :
The value of an uninitialized variable of function type is nil.
给定一个结构:
type foo struct {
bar func(int) int
}
当我var x foo
x.bar
的初始值是多少?
来自 the documentation :
The value of an uninitialized variable of function type is nil.