MCPcopy Index your code
hub / github.com/drekle/protoc-gen-goexample

github.com/drekle/protoc-gen-goexample @v0.0.1

Chat with this repo
repository ↗ · DeepWiki ↗ · release v0.0.1 ↗ · + Follow
8 symbols 18 edges 1 files 0 documented · 0%
What it actually does AI analysis from the code graph — generated when you open this
loading…
README

protoc-gen-goexample

An example of a protoc plugin in go

Build

go build .

Run the plugin

protoc --plugin protoc-gen-goexample --goexample_out=output example.proto

Passing additional data to generators

Parameters may be set for additional information

protoc --plugin protoc-gen-goexample --goexample_out=param1=value1,param2=value2:output example.proto

I believe an equivalent, cleaner, way to do this would be using the opt argument

protoc --plugin ./protoc-gen-goexample --goexample_out=output --goexample_opt=param1=value1,param2=value2 example.proto

Parameters shall apply to multiple files. See an example in generateCode for parsing comments. You might consider using annotations as comments to apply additional data at the message level, or field level, by adding annotations as leading comments.

Core symbols most depended-on inside this repo

PrintParameters
called by 1
main.go
getLocationMessage
called by 1
main.go
CreateMarkdownFile
called by 1
main.go
generateMessageMarkdown
called by 1
main.go
generateCode
called by 1
main.go
main
called by 0
main.go

Shape

Method 5
Struct 2
Function 1

Languages

Go100%

Modules by API surface

main.go8 symbols

For agents

$ claude mcp add protoc-gen-goexample \
  -- python -m otcore.mcp_server <graph>

⬇ download graph artifact

Ask about this repo answers extend the page