State interfaces

Tim Penhey tim.penhey at canonical.com
Thu Oct 31 19:59:14 UTC 2013


On 01/11/13 08:49, Nate Finch wrote:
> Preferably, if you find yourself needing an interface that only has A,
> make an interface that only has A, and have your function use that
> interface. :)
> 
> But that is a neat trick for when the above isn't possible for whatever
> reason.

Well, sometimes it makes sense for the type taking the interface to have
the interface defined as a whole, and the test may be making extensive
checking of just one part.

It just takes advantage of the composition model of Go.

Tim



More information about the Juju-dev mailing list