Comments (3)
At this point in time, it's a bit awkward to merge cmpopts into cmp since there would now be two ways to get at the cmpopts functionality.
Presumably everything in cmpopts would be replaced with a forward to the corresponding symbol in cmp, and marked as deprecated.
I think the separation makes a lot of sense from the perspective of the implementation, but it's pretty confusing as a user. Even as a user with an above-average understanding of cmp's internals.
from go-cmp.
I came here to ask the same question as @zombiezen. I just want to point out that the cmpopts
package isn't prominently visible from the cmp
documentation, so as a user I spent a bit of time to find what I was looking for, and couldn't in the cmp
package alone. When I eventually discovered the cmpopts
package I found what I needed.
So I would also encourage merging the two packages to make the documentation easier to use.
from go-cmp.
The original intention was to design a comparison library that was highly extensible with a small number of options.
Implementing cmpopts
as a separate package kept the implementation of cmp
honest such that cmpopts
does not rely on internal details of cmp
. In other words, cmpopts
is forced to be entirely implementable in terms of the first-class options provided by cmp
. This was done in reaction to other comparison libraries I looked at that supported many options and each option deeply touched internal details of the overall comparison logic.
That said, from a end-user perspective, I can see how the two being in the same package can be convenient. At this point in time, it's a bit awkward to merge cmpopts
into cmp
since there would now be two ways to get at the cmpopts
functionality.
from go-cmp.
Related Issues (20)
- Ideas for a v2 HOT 3
- Default support for the `netip` package HOT 1
- New minor release of the library? HOT 4
- cmp.Diff() switching from property diffs to "new object" diff when object changes significantly HOT 1
- Inconsistent whitespace produced by cmp.Diff HOT 2
- cmpopts: add EquateUnsetFields(want) or FilterFieldsFrom(want) HOT 1
- IgnoreFields and nested struct HOT 2
- Enable a dependency update tool HOT 2
- Package Name Mismatches HOT 4
- unhelpful output for difference in slices HOT 1
- How to implement jests.js's `expect.any(String)` like functionality? HOT 1
- cmpopts.IgnoreFields does not work on structs with an Equal method HOT 1
- Performance Issue Comparing Array Types HOT 1
- Naming clash for new cmp standard package HOT 4
- Comparing two fields with diffirent types that are semantically equivalent HOT 3
- String diff for UUIDs can use strings.Join syntax which makes it more confusing HOT 4
- Reporter truncating important context on diff output but leaving others alone
- How to add more context to Diff output?
- Error at init when running on Windows ARM HOT 3
- `cmp.Diff`: want to compare unexport structs like `reflect.DeepEqual`
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from go-cmp.