func Register(v interface{}, args ...string) {
	var (
		t = tryDereference(v)
		p = path.Join(args...)
	)
	mu.Lock()
	defer mu.Unlock()
	if et, ok := registry[t]; ok {
		if et != p {
			panic(errors.Errorf("type registred with alternate path %q != %q", et, p))
		}
		return
	}
	registry[t] = p
}
Register a type with the base url of the type
package typeurl
import (
	"encoding/json"
	"path"
	"reflect"
	"sync"
	"github.com/gogo/protobuf/proto"
	"github.com/gogo/protobuf/types"
	"github.com/pkg/errors"
)
var (
	mu       sync.Mutex
	registry = make(map[reflect.Type]string)
)
var ErrNotFound = errors.New("not found")