Skip to content

Commit

Permalink
spec: clarify zero value for complex types
Browse files Browse the repository at this point in the history
The enumeration of numeric types missed the complex types.
Clarify by removing the explicit enumeration and referring
to numeric types instead.

Fixes #21579.

Change-Id: If36c2421f8501eeec82a07f442ac2e16a35927ba
Reviewed-on: https://go-review.googlesource.com/58491
Reviewed-by: Matthew Dempsky <mdempsky@google.com>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
Reviewed-by: Rob Pike <r@golang.org>
  • Loading branch information
griesemer committed Aug 25, 2017
1 parent b976859 commit a9f832a
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion doc/go_spec.html
Original file line number Diff line number Diff line change
Expand Up @@ -6158,7 +6158,7 @@ <h3 id="The_zero_value">The zero value</h3>
and no explicit initialization is provided, the variable or value is
given a default value. Each element of such a variable or value is
set to the <i>zero value</i> for its type: <code>false</code> for booleans,
<code>0</code> for integers, <code>0.0</code> for floats, <code>""</code>
<code>0</code> for numeric types, <code>""</code>
for strings, and <code>nil</code> for pointers, functions, interfaces, slices, channels, and maps.
This initialization is done recursively, so for instance each element of an
array of structs will have its fields zeroed if no value is specified.
Expand Down

0 comments on commit a9f832a

Please sign in to comment.