]> Cypherpunks repositories - gostls13.git/commitdiff
reflect: expand doc for Value.Interface
authorRuss Cox <rsc@golang.org>
Thu, 1 Mar 2012 22:55:47 +0000 (17:55 -0500)
committerRuss Cox <rsc@golang.org>
Thu, 1 Mar 2012 22:55:47 +0000 (17:55 -0500)
R=golang-dev, r
CC=golang-dev
https://golang.org/cl/5716057

src/pkg/reflect/value.go

index 39f8acdea4626a91a088257792aee6dbc5d6e267..f3f7d639a0f05c9dd691b31ef7bebe743b78d97d 100644 (file)
@@ -800,13 +800,15 @@ func (v Value) CanInterface() bool {
        return v.flag&(flagMethod|flagRO) == 0
 }
 
-// Interface returns v's value as an interface{}.
+// Interface returns v's current value as an interface{}.
+// It is equivalent to:
+//     var i interface{} = (v's underlying value)
 // If v is a method obtained by invoking Value.Method
 // (as opposed to Type.Method), Interface cannot return an
 // interface value, so it panics.
 // It also panics if the Value was obtained by accessing
 // unexported struct fields.
-func (v Value) Interface() interface{} {
+func (v Value) Interface() (i interface{}) {
        return valueInterface(v, true)
 }