func noMerge(data []byte, desc *descriptor.FileDescriptorSet, pkgName, msgName string) error { parser := katydidproto.NewProtoNumParser(pkgName, msgName, desc) if err := parser.Init(data); err != nil { panic(err) } return katydidproto.NoLatentAppendingOrMerging(parser) }
func newProtoNumParser(pkgName, msgName string, desc *descriptor.FileDescriptorSet, filename string) (ResetParser, error) { pp := protoparser.NewProtoNumParser(pkgName, msgName, desc) bytes, err := ioutil.ReadFile(filename) if err != nil { return nil, fmt.Errorf("err <%v> reading file <%s>", err, filename) } if err := pp.Init(bytes); err != nil { return nil, fmt.Errorf("err <%v> parser.Init with bytes from filename <%s>", err, filename) } return pp, nil }