以下摘自The Go Programming Language:A var declaration creates a variable of a particular type, attaches a name to it, and sets its initial value. Each declaration has the general formvar name type = expressionEither the type or the = expression part may be omitted, but not both. If the type is omitted, it is determined by the initializer expression. If the expression is omitted, the initial value is the zero value for the type, which is 0 for numbers, false for booleans, “” for strings, and nil for interfaces and reference types (slice, pointer, map, channel, function). The zero value
...
继续阅读
(58)