dougblack/sleepy — pull request #4 by rakoo (2014-01-26 17:28:31+00:00)
Title: Support default implementation

By defining a base struct that doesn't support anything (`BaseResource`), we can define some kind of "default implementation", and later implement what we really care about.

Unfortunately I don't know exactly how this is called (type aliasing ?), but I presume it falls under a certain case of [type declaration](http://golang.org/ref/spec#Type_declarations).

Basically, `Bar` is a new type, which _behaves_ the same as `BaseResource`, so it has the same methods. However, if a method asked for a `BaseResource` as a parameter, you wouldn't be able to use it on a `Bar` object, because they _are_ different. But since the `AddResource` asks for an interface and Bar respects the interface, it's all green.