G
GoTool

Protobuf ↔ Go

Convert between Protobuf and Go structs

Input0
Output
0

About Protobuf ↔ Go Converter

Bidirectional converter between Protocol Buffer (proto3) definitions and Go structs. Proto → Go parses .proto files to generate Go structs; Go → Proto converts Go structs to proto3 message definitions with automatic type and field mapping.

FAQ

What proto syntax is supported?▼

Proto3 syntax including message, enum, nested types, repeated fields, and oneof.

How are types mapped?▼

Proto → Go: string→string, int32→int32, int64→int64, bool→bool, bytes→[]byte, float→float32, double→float64, repeated→slice. Go → Proto: reverse mapping, pointer→optional, slice→repeated, map→map<K,V>.

Can it handle imports and multiple structs?▼

Proto → Go recognizes external imports but doesn't resolve them. Go → Proto supports multiple struct definitions and auto-detects references between them.