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

Compare on Well Known Types is not fully supported #230

Open
shouichi opened this issue Nov 30, 2016 · 2 comments
Open

Compare on Well Known Types is not fully supported #230

shouichi opened this issue Nov 30, 2016 · 2 comments

Comments

@shouichi
Copy link

Hi do you have plan to support Compare method on types.Timestamp? For example,

import "google/protobuf/timestamp.proto";
import "github.com/gogo/protobuf/gogoproto/gogo.proto";

option (gogoproto.compare_all) = true

message Foo {
  google.protobuf.Timestamp timestamp = 1;
}

This gives me this.Timestamp.Compare undefined (type *types.Timestamp has no field or method Compare) compilation error.

Moreover, it seems that ptypes package doesn't have enough support; e.g., gostring_all option doesn't work neither.

Thanks!

@awalterschulze
Copy link
Member

GoString methods are defined for the types, how does gostring_all break?

@awalterschulze
Copy link
Member

6a92c87

I found another issue with compare #231
and I have added all current issues to the documentation.

Compare is now supported for most well known types, except struct, because compare does not support oneof yet.
It also doesn't work when timestamp is generated as time.Time or duration is generated as time.Duration.
These are all fixable, except maybe for maps, but I am too sick to do that now.
And I hope someone else will jump in.

@awalterschulze awalterschulze changed the title Plan to support Compare on timestamp? Compare on Well Known Types is not fully supported Nov 30, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants