Skip to content

Instantly share code, notes, and snippets.

@cep21
Last active November 2, 2016 18:06
Show Gist options
  • Save cep21/93be40c155795752e3d27a81bebb5e4d to your computer and use it in GitHub Desktop.
Save cep21/93be40c155795752e3d27a81bebb5e4d to your computer and use it in GitHub Desktop.
package news
import "store"
type Totaller interface {
Subtotal() float64
}
type NewsfeedRenderable struct {}
func (n *NewsfeedRenderable) RenderPage(t Totaller) {
}
// Calling the original run application function
func RunNewsfeed() {
// cannot use NewsfeedRenderable literal (type *NewsfeedRenderable) as type Renderable in argument to store.RunApplication:
// *NewsfeedRenderable does not implement Renderable (wrong type for RenderPage method)
// have RenderPage(Totaller)
// want RenderPage(store.Totaller)
store.RunApplication(nil, &NewsfeedRenderable{})
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment