# Packages
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
# README
protogen-demo
show how to develop your own proto codegen plugin, you can also read my blog post !
protoc-gen-demo
use google.golang.org/protobuf/compiler/protogen lib to demo how to develop proto codegen plugin
go build -o ./protoc-gen-demo/protoc-gen-demo.bin ./protoc-gen-demo
protoc \
--plugin=protoc-gen-demo=./protoc-gen-demo/protoc-gen-demo.bin \
--go_out=paths=source_relative:. \
--demo_out=foo=bar,paths=source_relative:. \
proto/pb.proto
protoc-gen-demo2
use github.com/lyft/protoc-gen-star lib to demo how to develop proto codegen plugin
go build -o ./protoc-gen-demo/protoc-gen-demo.bin ./protoc-gen-demo
protoc \
--plugin=protoc-gen-demo2=./protoc-gen-demo2/protoc-gen-demo2.bin \
--go_out=paths=source_relative:. \
--demo2_out=foo=bar,paths=source_relative:. \
proto/pb.proto
protoc-gen-debug
show how to debug your own plugin
-
protoc \ --plugin=protoc-gen-debug=./protoc-gen-debug/protoc-gen-debug.bin \ --go_out=paths=source_relative:. \ --debug_out=.:. \ proto/pb.proto
- and run
go run main.go
in protogen-demo folder`