Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Proteus is generating a proto message even when the struct is not marked for generation: #96

Open
aantelov87 opened this issue Nov 30, 2017 · 1 comment

Comments

@aantelov87
Copy link

aantelov87 commented Nov 30, 2017

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
}

@jwilander
Copy link
Contributor

I'm seeing this as well

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants