-
Notifications
You must be signed in to change notification settings - Fork 116
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
Adopt cmp.Diff for showing unmatched arguments #154
base: main
Are you sure you want to change the base?
Conversation
a37ae2a
to
6e34dff
Compare
# Conflicts: # go.mod
@r-hang @sywhang @JacobOaks, what's needed to get this PR into shape for approval? |
@r-hang @sywhang @JacobOaks LMK, I see other PRs going in. |
Hey @SpencerC, thanks for the contribution and sorry for the delay. While I understand that the go-cmp library has lots of users and powerful features, I think that having this mocking library expose another repository's types as part of its public interface could make it harder to maintain as we're tightly coupled with go-cmp. Is there a way for this library to own all of its exported types? |
Hey! Here are the options I see for avoiding exporting go-cmp arguments:
Can you think of any other options? I'm happy to do either of those if you think they're really preferable to exporting go-cmp types. I definitely agree with you in principle on maintaining minimal reliance on exported external deps. I feel like in the case of go-cmp though it's so established and so stable that it might as well be treated like a built-in type for the purposes of maintaining a library (like the golang.org/x/... packages used elsewhere in this library). Likewise, if users pose questions about how to properly configure rich diffs you can just say "refer to the go-cmp docs, we just pass those options through". |
Hey @SpencerC, I'm personally open to using wrapper type analogs for go-cmp options, I think that's more favorable than vendoring go-cmp in. Instead of initially adding 8 options, I think it makes sense to make go-cmp's drive diffing presentation for unmatched arguments and then port over the options individually as needed. What do you think? |
@r-hang, sorry just realized I didn't reply. That sounds fine to me, will just take some time for me to get back to this. Thanks! |
Migrating from: golang/mock#647 (comment)