Skip to content

anjmao/go2proto

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

11 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

go2proto

Generate Protobuf messages from given go structs. No RPC, not gogo syntax, just pure Protobuf messages.

Syntax

-f string
    Protobuf output file path. (default ".")
-filter string
    Filter by struct names. Case insensitive.
-p value
    Fully qualified path of packages to analyse. Relative paths ("./example/in") are allowed.

Example

Your package you wish to export must be inside of your working directory. Package paths can be fully-qualified or relative.

GO111MODULE=off go get -u github.com/anjmao/go2proto
cd ~/go/src/github.com/anjmao/go2proto
go2proto -f ./example/out -p ./example/in

Note

Generated code may not be perfect but since it just 180 lines of code you are free to adapt it for your needs.

About

Generate protobuf messages from go structs

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Contributors 3

  •  
  •  
  •  

Languages