Skip to content

Commit 52572af

Browse files
committed
reflect,doc: use "the" instead of "a" in IsZero docs
There is a subtle distinction between a value *being* the zero value vs being *equal to* the zero value. This was discussed at length in #31450. Using "a zero value" in the docs suggests that there may be more than zero value. That is possible on the "equal to zero value" reading, but not the "is zero" reading that we selected for the semantics of IsZero. This change attempts to prevent any confusion on this front by switching to "the zero value" in the documentation. And while we're here, eliminate a double-space. (Darn macbook keyboards.) Change-Id: Iaa02ba297438793f5a90be9919a4d53baef92f8e Reviewed-on: https://go-review.googlesource.com/c/go/+/182617 Run-TryBot: Josh Bleecher Snyder <[email protected]> TryBot-Result: Gobot Gobot <[email protected]> Reviewed-by: Brad Fitzpatrick <[email protected]>
1 parent bc27b64 commit 52572af

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

doc/go1.13.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -292,11 +292,11 @@ <h3 id="minor_library_changes">Minor changes to the library</h3>
292292
<dl id="reflect"><dt><a href="/pkg/reflect/">reflect</a></dt>
293293
<dd>
294294
<p><!-- CL 171337 -->
295-
The new <a href="/pkg/reflect/#Value.IsZero"><code>Value.IsZero</code></a> method reports whether a <code>Value</code> is a zero value for its type.
295+
The new <a href="/pkg/reflect/#Value.IsZero"><code>Value.IsZero</code></a> method reports whether a <code>Value</code> is the zero value for its type.
296296
</p>
297297

298298
<p><!-- CL 174531 -->
299-
The <a href="/pkg/reflect/#MakeFunc"><code>MakeFunc</code></a> function now allows assignment conversions on returned values, instead of requiring exact type match. This is particularly useful when the type being returned is an interface type, but the value actually returned is a concrete value implementing that type.
299+
The <a href="/pkg/reflect/#MakeFunc"><code>MakeFunc</code></a> function now allows assignment conversions on returned values, instead of requiring exact type match. This is particularly useful when the type being returned is an interface type, but the value actually returned is a concrete value implementing that type.
300300
</p>
301301

302302
</dl><!-- reflect -->

src/reflect/value.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1076,7 +1076,7 @@ func (v Value) IsValid() bool {
10761076
return v.flag != 0
10771077
}
10781078

1079-
// IsZero reports whether v is a zero value for its type.
1079+
// IsZero reports whether v is the zero value for its type.
10801080
// It panics if the argument is invalid.
10811081
func (v Value) IsZero() bool {
10821082
switch v.kind() {

0 commit comments

Comments
 (0)