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

gostring plugin does not add package name for nullable enums #635

Open
godfried opened this issue Oct 11, 2019 · 0 comments
Open

gostring plugin does not add package name for nullable enums #635

godfried opened this issue Oct 11, 2019 · 0 comments

Comments

@godfried
Copy link
Contributor

The gostring plugin does not add the package name of a nullable enum to the generated code.
For nullable enums, a closure is generated so that they can be rendered as pointers. The same approach is used for basic types (e.g. strings, ints).
However, the enums have a package and this is not added to the closure's function signature.
Example

message EnumNullable {
  optional TheEnum TheEnum = 1 [(gogoproto.nullable) = true];
}
enum TheEnum {
	TheEnum0 = 0;
}

GoString result:

&issue640.EnumNullable{TheEnum: func(v TheEnum) *TheEnum { return &v } ( 0 ),
}

Expected:

&issue640.EnumNullable{TheEnum: func(v issue640.TheEnum) *issue640.TheEnum { return &v } ( 0 ),
}
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

1 participant