]> Cypherpunks repositories - gostls13.git/commitdiff
fmt: clarify reflect.Value printing
authorNodir Turakulov <nodir@google.com>
Fri, 16 Oct 2015 08:33:28 +0000 (01:33 -0700)
committerIan Lance Taylor <iant@golang.org>
Mon, 19 Oct 2015 18:29:36 +0000 (18:29 +0000)
fmt docs say:

  If the operand is a reflect.Value, the concrete value it
  holds is printed as if it was the operand.

It implies recursive application of this rule, which is not the case.
Clarify the docs.

Change-Id: I019277c7c6439095bab83e5536aa06403638aa51
Reviewed-on: https://go-review.googlesource.com/15952
Reviewed-by: Ian Lance Taylor <iant@golang.org>
src/fmt/doc.go

index 20a09c5f5b341532d3824849c8971b3c6042acc2..4eea48eb6b0095ce2eecc7684e7ba6a316ef8657 100644 (file)
        formatting considerations apply for operands that implement
        certain interfaces. In order of application:
 
-       1. If the operand is a reflect.Value, the concrete value it
-       holds is printed as if it was the operand.
+       1. If the operand is a reflect.Value, the operand is replaced by the
+       concrete value that it holds, and printing continues with the next rule.
 
        2. If an operand implements the Formatter interface, it will
        be invoked. Formatter provides fine control of formatting.