When two instances of the same interface mock are created, the same instance is actually reused. Presumably this is an optimisation due to the use of struct{}. By changing the type to struct{int} we will be able to have distinct instances at the cost of one word of memory per instance.
When two instances of the same interface mock are created, the same instance is actually reused. Presumably this is an optimisation due to the use of struct{}. By changing the type to struct{int} we will be able to have distinct instances at the cost of one word of memory per instance.