Would you be interested in having a compare typewriter?
This would basically just compare each field for a type from top to bottom.
When a field is found with a compare != 0 then that value is returned.
Here is some example generated code.
func (this *MyType) Compare(that *MyType) int {
if this.Field1 != that.Field1 {
if this.Field1 < that.Field1 {
return -1
}
return 1
}
if c := bytes.Compare(this.Field2, that.Field2); c != 0 {
return c
}
if c := this.Field3.Compare(that.Field3); c != 0 {
return c
}
return 0
}
Hi
Would you be interested in having a compare typewriter?
This would basically just compare each field for a type from top to bottom. When a field is found with a compare != 0 then that value is returned.
Here is some example generated code.
Would you be interested in such a pull request?