func (p pointer) getInt32Ptr() *int32 {
	if p.v.Type().Elem().Elem() == reflect.TypeOf(int32(0)) {
		return p.v.Elem().Interface().(*int32)
	}
	return p.v.Elem().Convert(int32PtrType).Interface().(*int32)
}
The toInt32Ptr/Slice methods don't work because of enums.
Instead, we must use set/get methods for the int32ptr/slice case.
/*
func (p pointer) toInt32Ptr() **int32 {
return p.v.Interface().(**int32)
}
func (p pointer) toInt32Slice() *[]int32 {
return p.v.Interface().(*[]int32)
}
package proto
import (
	"reflect"
	"sync"
)
const unsafeAllowed = false
type field []int
func toField(f *reflect.StructField) field {
	return f.Index
}
var invalidField = field(nil)
var zeroField = field([]int{})
func (f field) IsValid() bool { return f != nil }
type pointer struct {
	v reflect.Value
}
func toPointer(i *Message) pointer {
	return pointer{v: reflect.ValueOf(*i)}
}
func toAddrPointer(i *interface{}, isptr bool) pointer {
	v := reflect.ValueOf(*i)
	u := reflect.New(v.Type())
	u.Elem().Set(v)
	return pointer{v: u}
}
func valToPointer(v reflect.Value) pointer {
	return pointer{v: v}
}
func (p pointer) offset(f field) pointer {
	return pointer{v: p.v.Elem().FieldByIndex(f).Addr()}
}
func (p pointer) isNil() bool {
	return p.v.IsNil()
}
func grow(s reflect.Value) reflect.Value {
	n, m := s.Len(), s.Cap()
	if n < m {
		s.SetLen(n + 1)
	} else {
		s.Set(reflect.Append(s, reflect.Zero(s.Type().Elem())))
	}
	return s.Index(n)
}
func (p pointer) toInt64() *int64 {
	return p.v.Interface().(*int64)
}
func (p pointer) toInt64Ptr() **int64 {
	return p.v.Interface().(**int64)
}
func (p pointer) toInt64Slice() *[]int64 {
	return p.v.Interface().(*[]int64)
}
var int32ptr = reflect.TypeOf((*int32)(nil))
func (p pointer) toInt32() *int32 {
	return p.v.Convert(int32ptr).Interface().(*int32)
}