Joe Tsai
Joe Tsai
Suppose we had `IgnoreFieldsExcept`, what is the user expectation when they see something like the following? ```go cmp.Diff(x, y, cmp.Options{ cmpopts.IgnoreFieldsExcept(MyStruct{}, "FooField"), cmpopts.IgnoreFieldsExcept(MyStruct{}, "BarField"), }) ``` I may be mistaken,...
I'm not sure how that'd be implemented. The options framework of `cmp` assumes that everything is included except for the things that are explicitly ignored. The implementation of `cmpopts.IncludeFields` would...
\cc @neild, do you have an opinion about whether to add `IgnoreFieldsExcept`? I personally have also needed something like `IgnoreFieldsExcept` a few times. My fears about users being surprised by...
Yep, fixed.
In Go, a `[]T` and `[]R` are invariant types (i.e., `[]T` is not a sub-type of `[]R`, nor is `[]R` a sub-type of `[]T` assuming `T` is not the same...
If you want to operate on both `[]int` and `[]main.intHolder`, you would need a transformer that operates on either of those two types and coverts it a []int. See https://play.golang.org/p/iRvh9tTJk_q...
> It would be nice to be able to do that using a transformer that operates on just an element. That's not possible, is it? Perhaps. The current semantic is...
Under what circumstance would people want it to follow the alias? The whole point of type aliases is to be able to move a type in a way that is...
Here's a real example of breakage: * A type `Foo` is lives at `path/to/my/package` * At some point, type `Foo` is moved to `path/to/my/internal/package`, and an alias is placed in...
The approach taken in `reflect.go` seems fundamentally problematic since the type information needed has already been lost when the stub program is run. Probably the proper way to do this...