Closed gavv closed 2 months ago
Thanks for sharing this tool.
I've encountered a bug: if a field is a type alias to string, generated compare function will have this:
if c := strings.Compare(this.Foo, that.Foo); c != 0 { return c }
which doesn't compile:
cannot use this.Foo (variable of type StringAlias) as string value in argument to strings.Compare
This PR fixes it by changing the generated code to:
if c := strings.Compare(string(this.Foo), string(that.Foo)); c != 0 { return c }
Thank you so much for the fix and unit test <3 Sorry for the long wait
Thanks for sharing this tool.
I've encountered a bug: if a field is a type alias to string, generated compare function will have this:
which doesn't compile:
This PR fixes it by changing the generated code to: