func extendable(p interface{}) (extendableProto, error) {
	switch p := p.(type) {
	case extendableProto:
		if isNilPtr(p) {
			return nil, fmt.Errorf("proto: nil %T is not extendable", p)
		}
		return p, nil
	case extendableProtoV1:
		if isNilPtr(p) {
			return nil, fmt.Errorf("proto: nil %T is not extendable", p)
		}
		return extensionAdapter{p}, nil
	case extensionsBytes:
		return slowExtensionAdapter{p}, nil
	}
	return nil, errNotExtendable
}
extendable returns the extendableProto interface for the given generated proto message.
If the proto message has the old extension format, it returns a wrapper that implements
the extendableProto interface.
package proto
import (
	"errors"
	"fmt"
	"io"
	"reflect"
	"strconv"
	"sync"
)
var ErrMissingExtension = errors.New("proto: missing extension")
type ExtensionRange struct {
	Start, End int32  
}
type extendableProto interface {
	Message
	ExtensionRangeArray() []ExtensionRange
	extensionsWrite() map[int32]Extension
	extensionsRead() (map[int32]Extension, sync.Locker)
}
type extendableProtoV1 interface {
	Message
	ExtensionRangeArray() []ExtensionRange
	ExtensionMap() map[int32]Extension
}
type extensionAdapter struct {
	extendableProtoV1
}
func (e extensionAdapter) extensionsWrite() map[int32]Extension {
	return e.ExtensionMap()
}
func (e extensionAdapter) extensionsRead() (map[int32]Extension, sync.Locker) {
	return e.ExtensionMap(), notLocker{}
}
type notLocker struct{}
func (n notLocker) Lock()   {}
func (n notLocker) Unlock() {}