goprotobuf: gofixes for reflect API changes.
R=dsymonds
CC=golang-dev
http://codereview.appspot.com/4425077
diff --git a/proto/encode.go b/proto/encode.go
index 8dc6a74..99ea31a 100644
--- a/proto/encode.go
+++ b/proto/encode.go
@@ -303,7 +303,7 @@
// Can the object marshal itself?
iv := unsafe.Unreflect(p.stype, unsafe.Pointer(base+p.offset))
if m, ok := iv.(Marshaler); ok {
- if isNil(reflect.NewValue(iv)) {
+ if isNil(reflect.ValueOf(iv)) {
return ErrNil
}
data, err := m.Marshal()
@@ -514,7 +514,7 @@
// Can the object marshal itself?
iv := unsafe.Unreflect(p.stype, unsafe.Pointer(&s[i]))
if m, ok := iv.(Marshaler); ok {
- if reflect.NewValue(iv).IsNil() {
+ if reflect.ValueOf(iv).IsNil() {
return ErrNil
}
data, err := m.Marshal()