From af95499619f731e8f93a316ba70fa2cd732d0d17 Mon Sep 17 00:00:00 2001 From: Russ Cox Date: Thu, 1 Mar 2012 17:55:47 -0500 Subject: [PATCH] reflect: expand doc for Value.Interface R=golang-dev, r CC=golang-dev https://golang.org/cl/5716057 --- src/pkg/reflect/value.go | 6 ++++-- 1 file 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) } -- 2.50.0