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

Stringer interface support #3

Open
powerman opened this issue Apr 25, 2017 · 2 comments
Open

Stringer interface support #3

powerman opened this issue Apr 25, 2017 · 2 comments

Comments

@powerman
Copy link

Is there any reason to generate diff text using

c.saveDiff(a.Int(), b.Int())

instead of

c.saveDiff(a, b)

At a glance second way is better because it keeps original type and thus if that type implements Stringer interface then diff will contains values in much more readable form than just a number. (With a lot of iota consts reading diff with numbers is really hard.) Of course, same probably apply to other types, not just to integer ones.

@daniel-nichter
Copy link
Member

Sorry for slow reply. No significant reason that I can recall. To see how it works out, can you submit a PR? To maintain backward-compatibility, it might need to be an option that's off by default because as other issues/PRs have noted, some people depends on the diff output, so if we change it we mess things up for them.

@powerman
Copy link
Author

I'm afraid it's a bit too late - I've already solved this issue another way with https://godoc.org/github.com/powerman/check. Feel free to close this issue if you like to.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

2 participants