You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I propose that we add a vet check warning about uses of reflect.DeepEqual with values of types that are 1) imported; 2) contain references to unexported fields. Those are cases where reflect.DeepEqual is testing the internal state of a type defined in a different package, which means that the call is subject to breaking if the other package changes the type definition.
I believe that this meets vet's requirements for correctness and precision. However, I don't know how frequent the problem is.
I note that there is already a check in vet that warns about uses of reflect.DeepEqual specifically for the type reflect.Value (though I don't know how to actually run that check; it's not part of standard vet). This more general check could perhaps subsume that one.
CC @golang/tools-team
tmthrgd, adonovan, findleyr, ericlagergren, phenpessoa and 3 morecipherboy and phenpessoa