proteus
proteus copied to clipboard
Proteus is generating a proto message even when the struct is not marked for generation:
the structs are not marked for generation but proteus is generating a proto file with a Address message related to Address type from go code. Check below what I am doing:
package order
type Address struct {
City string
Country string
Line1 string
Line2 string
ZipCode string
State string
}
type Shipping struct {
Address *Address
Carrier string
FirstName string
LastName string
Phone string
TrackingNumber string
}
Output after proteus execution:
syntax = "proto3";
package example.pkg.order;
import "github.com/gogo/protobuf/gogoproto/gogo.proto";
option (gogoproto.protosizer_all) = true;
option (gogoproto.sizer_all) = false;
option go_package = "order";
message Address {
option (gogoproto.goproto_getters) = false;
option (gogoproto.typedecl) = false;
string city = 1;
string country = 2;
string line1 = 3;
string line2 = 4;
string zip_code = 5;
string state = 6;
}
Expected output:
syntax = "proto3";
package example.pkg.order;
import "github.com/gogo/protobuf/gogoproto/gogo.proto";
option (gogoproto.protosizer_all) = true;
option (gogoproto.sizer_all) = false;
option go_package = "order";
I think that is a bug because it is working proper if the Address type is embedded in the Shipping type for example:
package order
type Address struct {
City string
Country string
Line1 string
Line2 string
ZipCode string
State string
}
type Shipping struct {
Address
Carrier string
FirstName string
LastName string
Phone string
TrackingNumber string
}
I'm seeing this as well