internal/value: rename the Unwrap method as ProtoUnwrap
Add a Proto prefix before the Unwrap method to reduce the probability that
it would ever conflict with a method of the same name that a
custom implementation of Enum, Message, List, or Map may have.
Change-Id: I628bf8335583f2747ab4589f3e6ff82e4501ce98
Reviewed-on: https://go-review.googlesource.com/c/151817
Reviewed-by: Herbie Ong <herbie@google.com>
diff --git a/internal/value/convert.go b/internal/value/convert.go
index 6660d44..cc9d94d 100644
--- a/internal/value/convert.go
+++ b/internal/value/convert.go
@@ -17,7 +17,7 @@
// Unwrapper unwraps the value to the underlying value.
// This is implemented by List and Map.
type Unwrapper interface {
- Unwrap() interface{}
+ ProtoUnwrap() interface{}
}
var (
@@ -174,7 +174,7 @@
return pref.ValueOf(mvOf(v).ProtoReflect())
},
GoValueOf: func(v pref.Value) reflect.Value {
- rv := reflect.ValueOf(v.Message().(Unwrapper).Unwrap())
+ rv := reflect.ValueOf(v.Message().(Unwrapper).ProtoUnwrap())
if rv.Type() != t {
panic(fmt.Sprintf("invalid type: got %v, want %v", rv.Type(), t))
}