Skip to content

Instantly share code, notes, and snippets.

@ktr0731
Created August 7, 2018 04:10
Show Gist options
  • Save ktr0731/aff6738adac7e8f2e2f3517f39321a27 to your computer and use it in GitHub Desktop.
Save ktr0731/aff6738adac7e8f2e2f3517f39321a27 to your computer and use it in GitHub Desktop.
syntax = "proto3";
import "b.proto";
package api;
message Foo {
Bar bar = 1;
}
syntax = "proto3";
package api;
message Bar {}
package main
import (
"log"
"github.com/jhump/protoreflect/desc/protoparse"
)
func main() {
p := protoparse.Parser{ImportPaths: []string{".", "api"}}
_, err := p.ParseFiles("api/a.proto", "api/b.proto")
if err != nil {
log.Fatal(err)
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment