Last active
May 31, 2018 09:36
-
-
Save SirEdvin/e621e1b1ca6342cf033a8e9720294574 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
type Node interface { | |
Prepare() | |
Run() | |
} | |
func doSomeWork(n Node) { | |
// ... | |
n.Prepare() | |
// ... | |
n.Run() | |
// ... | |
} | |
type Command struct {} | |
func (Command) Prepare() { | |
// ... | |
} | |
func (Command) Run() { | |
// ... | |
} | |
type Spawner struct {} | |
func (Spawner) Prepare() { | |
// ... | |
} | |
func (Spawner) Run() { | |
// ... | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment