Commit c812816
Nudge people to use custom comparers rather than Ignore/Allow Unexported options (#115)
A common scenario is:
1. someone uses cmp.Diff on big.Int (transitively)
2. they get a message that says uses Ignore/Allow Unexported options
3. they see that AllowUnexported is hard to use correctly
4. they use IgnoreUnexported
They end up with:
cmpopts.IgnoreUnexported(big.Int{})
Which definitely doesn't do what's intended.
If we point out that a custom comparer is what they most likely need, then they are more likely to use cmp correctly1 parent 2e500c5 commit c812816
2 files changed
+6
-2
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
112 | 112 | | |
113 | 113 | | |
114 | 114 | | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
115 | 119 | | |
116 | 120 | | |
117 | 121 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
225 | 225 | | |
226 | 226 | | |
227 | 227 | | |
228 | | - | |
| 228 | + | |
229 | 229 | | |
230 | 230 | | |
231 | 231 | | |
| |||
371 | 371 | | |
372 | 372 | | |
373 | 373 | | |
374 | | - | |
| 374 | + | |
375 | 375 | | |
376 | 376 | | |
377 | 377 | | |
| |||
0 commit comments