Last active
November 2, 2016 18:06
-
-
Save cep21/93be40c155795752e3d27a81bebb5e4d to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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