]> Cypherpunks repositories - gostls13.git/commitdiff
reflect,doc: use "the" instead of "a" in IsZero docs
authorJosh Bleecher Snyder <josharian@gmail.com>
Mon, 17 Jun 2019 19:57:40 +0000 (12:57 -0700)
committerJosh Bleecher Snyder <josharian@gmail.com>
Tue, 18 Jun 2019 15:08:08 +0000 (15:08 +0000)
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 <josharian@gmail.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
doc/go1.13.html
src/reflect/value.go

index 5723fee1b346f21edab354252556417880fdf9bf..1f83c0d9a03a978c6bc7e68f5d4922044bc055f8 100644 (file)
@@ -292,11 +292,11 @@ TODO
 <dl id="reflect"><dt><a href="/pkg/reflect/">reflect</a></dt>
   <dd>
     <p><!-- CL 171337 -->
-      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.
+      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.
     </p>
 
     <p><!-- CL 174531 -->
-      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.
+      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.
     </p>
 
 </dl><!-- reflect -->
index c58b2d2567012ae2b90d6b97fd08f1e935ff8d15..218b4d25cc223f3973fb78a1bf878f7dd802a1bf 100644 (file)
@@ -1076,7 +1076,7 @@ func (v Value) IsValid() bool {
        return v.flag != 0
 }
 
-// IsZero reports whether v is a zero value for its type.
+// IsZero reports whether v is the zero value for its type.
 // It panics if the argument is invalid.
 func (v Value) IsZero() bool {
        switch v.kind() {