qur / withmock

Automatic Go package mock generation tool
Other
71 stars 9 forks source link

Multiple instances of same type collide for Interface mocks #27

Closed qur closed 10 years ago

qur commented 10 years ago

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.