func (r *ImportResolver) ResolveImport(source, importPath string) string {
	if r != nil {
		res := r.resolveImport(clean(source), clean(importPath))
		if res != "" {
			return res
		}
		if r.SkipFallbackRules {
			return importPath
		}
	}
	return ResolveImport(importPath)
}
ResolveImport resolves the given import path in the context of the given
source file. If a matching alternate has been registered with this resolver
via a call to RegisterImportPath or RegisterImportPathFrom, then the
registered path is returned. Otherwise, the given import path is returned
unchanged.
package desc
import (
	"fmt"
	"path/filepath"
	"reflect"
	"strings"
	"sync"
	"github.com/golang/protobuf/proto"
	dpb "github.com/golang/protobuf/protoc-gen-go/descriptor"
)
var (
	globalImportPathConf map[string]string
	globalImportPathMu   sync.RWMutex
)
func RegisterImportPath(registerPath, importPath string) {
	if len(importPath) == 0 {
		panic("import path cannot be empty")
	}
	desc := proto.FileDescriptor(registerPath)
	if len(desc) == 0 {
		panic(fmt.Sprintf("path %q is not a registered proto file", registerPath))
	}
	globalImportPathMu.Lock()
	defer globalImportPathMu.Unlock()
	if reg := globalImportPathConf[importPath]; reg != "" {
		panic(fmt.Sprintf("import path %q already registered for %s", importPath, reg))
	}
	if globalImportPathConf == nil {
		globalImportPathConf = map[string]string{}
	}
	globalImportPathConf[importPath] = registerPath
}
func ResolveImport(importPath string) string {
	importPath = clean(importPath)
	globalImportPathMu.RLock()
	defer globalImportPathMu.RUnlock()
	reg := globalImportPathConf[importPath]
	if reg == "" {
		return importPath
	}
	return reg
}
type ImportResolver struct {
	children    map[string]*ImportResolver
	importPaths map[string]string
	SkipFallbackRules bool
}