You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
cmp's diff output is mostly valid Go and so can be nicely used to fill in the want part of a test by running the test with an empty want and then copying from cmp's diff output.
However when cmp is printing, for example, two different time.Time values, it uses the formatting as returned by the String() method. I think it would be more useful, or should be an option, it if used the GoString() method instead. GoString() is supposed to return valid Go code, which would fit into the existing output style of cmp. For time.Time, it returns Go code to create that time value, which is more useful than the string format of the value.
The text was updated successfully, but these errors were encountered:
cmp's diff output is mostly valid Go and so can be nicely used to fill in the
want
part of a test by running the test with an emptywant
and then copying from cmp's diff output.However when cmp is printing, for example, two different time.Time values, it uses the formatting as returned by the String() method. I think it would be more useful, or should be an option, it if used the GoString() method instead. GoString() is supposed to return valid Go code, which would fit into the existing output style of cmp. For time.Time, it returns Go code to create that time value, which is more useful than the string format of the value.
The text was updated successfully, but these errors were encountered: