From: Rob Pike Date: Tue, 20 Sep 2011 20:26:57 +0000 (-0700) Subject: reflect: add comment about the doubled semantics of Value.String. X-Git-Tag: weekly.2011-09-21~15 X-Git-Url: http://www.git.cypherpunks.su/?a=commitdiff_plain;h=86e65bac5c9368fc807f8c0356fe5162fb68b09e;p=gostls13.git reflect: add comment about the doubled semantics of Value.String. R=rsc CC=golang-dev https://golang.org/cl/5091044 --- diff --git a/src/pkg/reflect/value.go b/src/pkg/reflect/value.go index 8e5a6282cf..1cace3fdaf 100644 --- a/src/pkg/reflect/value.go +++ b/src/pkg/reflect/value.go @@ -1444,6 +1444,8 @@ func (v Value) String() string { case String: return *(*string)(iv.addr) } + // If you call String on a reflect.Value of other type, it's better to + // print something than to panic. Useful in debugging. return "<" + iv.typ.String() + " Value>" }