Prototool is a tool for working with Protocol Buffers.
- A formatter that formats you Protobuf files.
- A generator that generates clone code of go language.
Protofmt formats protobuf files.
go install github.com/liwnn/prototool/cmd/protofmt@latest
protofmt [flags] [path ...]
flags:
- -w
Do not print reformatted output to standard output. It overrides the file. - -a
Align the field
- format example.proto and print to console
protofmt -a ./example.proto
- format example.proto and overwrite the file
protofmt -w -a ./example.proto
protoclone generate protobuf file's clone code for go.
go install github.com/liwnn/prototool/cmd/protoclone-go@latest
protoclone-go [flags] [path ...]
flags:
- -w Do not print reformatted output to standard output. It write to the file.
- -m <message[,message]> Generate clone code for message.
- Generate clone code for file example.proto and print to console
protoclone-go ./example.proto
- Generate clone code for file example.proto and print to example.clone.go
protofmt -w=example.clone.go ./example.proto