Allow side-effect free error-tracking
This is an alternative proposal to !69 (closed)
It avoids having to expose the underlying errortracking implementation through the LabKit API, which is something we specifically want to avoid.
This is done by allowing the caller to override the "StateProvider". The default state provider will use global state and should be used for production.
In tests, the state provider can injected using WithStateProvider(errortracking.NewStateProvider()) to ensure that the tests remain side-effect free.
If we agree on this approach, this pattern will be applied to other packages too.
cc @ash2k
Edited by Andrew Newdigate