You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
If the operand is a reflect.Value, the concrete value it
holds is printed as if it was the operand.
The commit that introduced this behavior has message:
When a reflect.Value is passed to Printf (etc.), fmt called the
String method, which does not disclose its contents. To get the
contents, one could call Value.Interface(), but that is illegal
if the Value is not exported or otherwise forbidden.
The motivation was to disclose the contents of a reflect.Value.
However, fmt doesn't disclose the contents of a *reflect.Value, which is inconsistent.
Background
fmt
treatsreflect.Value
especially:The commit that introduced this behavior has message:
The motivation was to disclose the contents of a
reflect.Value
.However, fmt doesn't disclose the contents of a
*reflect.Value
, which is inconsistent.https://play.golang.org/p/EcJkj0bx8b
Proposal
Modify the spec to
and make corresponding changes to the implementation.
Examples
The text was updated successfully, but these errors were encountered: