in pkg/converter/protopackage.go [63:89]
func (pkg *ProtoPackage) relativelyLookupType(name string) (*descriptor.DescriptorProto, bool, Comments, string) {
components := strings.SplitN(name, ".", 2)
switch len(components) {
case 0:
glog.V(1).Info("empty message name")
return nil, false, Comments{}, ""
case 1:
found, ok := pkg.types[components[0]]
return found, ok, pkg.comments[components[0]], pkg.path[components[0]]
case 2:
glog.Infof("looking for %s in %s at %s (%v)", components[1], components[0], pkg.name, pkg)
if child, ok := pkg.children[components[0]]; ok {
found, ok, comments, path := child.relativelyLookupType(components[1])
return found, ok, comments, path
}
if msg, ok := pkg.types[components[0]]; ok {
found, ok, path := relativelyLookupNestedType(msg, components[1])
return found, ok, pkg.comments[components[0]], pkg.path[components[0]] + "." + path
}
glog.V(1).Infof("no such package nor message %s in %s", components[0], pkg.name)
return nil, false, Comments{}, ""
default:
glog.Fatal("not reached")
return nil, false, Comments{}, ""
}
}