I am prototyping a meta model on top of proto3. To generate domain specific boilerplate as the go proto3 extension syntax is ridiculously expressive. My domain proto files depend on meta.proto
which contain the extensions.
I can compile the these to go. When including the meta.proto
file the generated go ends up with the following include block:
import proto "github.com/golang/protobuf/proto"
import fmt "fmt"
import math "math"
import google_protobuf "google/protobuf" <--- this import does not exist !!
My extension file has the following structure(based off this):
syntax = "proto2";
package "...";
option go_package = "...";
import "google/protobuf/descriptor.proto"; <--- this causes the import
// message MyExtensionClass ...
// message MyExtensionField ...
extend google.protobuf.MessageOptions {
optional MyExtensionClass class = 50000;
}
extend google.protobuf.FieldOptions {
optional MyExtensionField field = 50001;
}
I know the solution is likely very simple, the google/protobuf
include is meant for C++ generation.
In my workspace the included package should be "github.com/golang/protobuf/protoc-gen-go/descriptor"