mirror of
https://github.com/golang/go
synced 2024-11-22 07:24:47 -07:00
reflect: expand doc for Value.Interface
R=golang-dev, r CC=golang-dev https://golang.org/cl/5716057
This commit is contained in:
parent
103c9db747
commit
af95499619
@ -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)
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user