Closed jamestelfer closed 1 year ago
The solution to this could be using the DisableCapacities
configuration of go-spew
. This would obviously affect other users of the library, but I'm not sure that's a bad thing if it's mentioned clearly in the release notes. It just means recreating snapshots.
I have snapshots that have a
[]byte
slice member as part of a struct that is snapshotted. This saves the slice capacity to the snapshot file, resulting in failures when tests run on different machines (as capacity is expanded differently).For example:
These slices are effectively identical, varying only by capacity.
I'm not sure if this behaviour is desired in general (even though it's not for me) or expected. I'm happy to look at creating a fix, let me know.
Thanks for the really useful library!