Created
August 7, 2018 04:10
-
-
Save ktr0731/aff6738adac7e8f2e2f3517f39321a27 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
syntax = "proto3"; | |
import "b.proto"; | |
package api; | |
message Foo { | |
Bar bar = 1; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
syntax = "proto3"; | |
package api; | |
message Bar {} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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