-
Notifications
You must be signed in to change notification settings - Fork 55
Description
Several users have asked and/or submitted forks/PRs to make deep.Equal thread-safe. The problem being solved is that go-test/deep uses package-level vars/settings, like deep.CompareUnexportedFields. So if two tests want different options, they can't (or, they can't run in parallel).
The fix is, of course, to remove package-level vars/settings (something like the relatively new flags). But there are two challenges:
This package is widely used, so the v1 API can't be broken. Either a new function needs to be added (deep.EqualP for "parallel'?) or a v2 needs to be created so v1 users won't be affected (they'll have to explicitly change their package/path/import).
The fewer the internal changes the better. Some PRs modify a lot, which makes it very difficult to verify that nothing has been broken. The internals of this package are necessarily very complicated, and even with 100% test cover, it's difficult to make doubly certain that comparisons are done correctly.
I'm very busy, so I'm not sure if I'll ever have time to do this. If someone else does, please start small with a minimal implementation that fixes the "problem #1": not being able to run in parallel with different vars/settings.