aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRuss Cox <rsc@golang.org>2012-03-01 17:55:47 -0500
committerRuss Cox <rsc@golang.org>2012-03-01 17:55:47 -0500
commitaf95499619f731e8f93a316ba70fa2cd732d0d17 (patch)
tree494170fbd5467670d12b78798f364a7b08d1a86a
parent103c9db74737afc67c394e3c68c746ba176f2b49 (diff)
downloadgo-af95499619f731e8f93a316ba70fa2cd732d0d17.tar.gz
go-af95499619f731e8f93a316ba70fa2cd732d0d17.zip
reflect: expand doc for Value.Interface
R=golang-dev, r CC=golang-dev https://golang.org/cl/5716057
-rw-r--r--src/pkg/reflect/value.go6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/pkg/reflect/value.go b/src/pkg/reflect/value.go
index 39f8acdea4..f3f7d639a0 100644
--- a/src/pkg/reflect/value.go
+++ b/src/pkg/reflect/value.go
@@ -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)
}