]> Cypherpunks repositories - gostls13.git/commit
go/constant: document that Value.String and ExactString return quoted strings
authorRobert Griesemer <gri@golang.org>
Wed, 7 Sep 2016 00:26:15 +0000 (17:26 -0700)
committerRobert Griesemer <gri@golang.org>
Wed, 7 Sep 2016 04:28:35 +0000 (04:28 +0000)
commit238274df4eee1752f51b288a11eddaf5365123bf
tree1d46191e653acc19958477082e4dce8c990d64f1
parentbdb3b790c66444c388529fa1d9b3f4d6aaa4c13f
go/constant: document that Value.String and ExactString return quoted strings

This has always been the case but it was not obvious from the documentation.
The reason for the quoting is that String() may return an abbreviated string,
starting with double-quote (") but ending in ... (w/o a quote). The missing
quote indicates the abbreviation (in contrast to a string ending in ...").

constant.StringVal can be used to obtain the unquoted string of a String Value.

Change-Id: Id0ba45b6ff62b3e024386ba8d907d6b3a4fcb6d7
Reviewed-on: https://go-review.googlesource.com/28576
Reviewed-by: Alan Donovan <adonovan@google.com>
src/go/constant/value.go