Skip to content

Instantly share code, notes, and snippets.

@gonzaloserrano
Created April 1, 2016 10:10
Show Gist options
  • Save gonzaloserrano/1cb118a4c8f271986d8808e14bca8248 to your computer and use it in GitHub Desktop.
Save gonzaloserrano/1cb118a4c8f271986d8808e14bca8248 to your computer and use it in GitHub Desktop.
// RunnerFunc allows using ordinary functions as Runner implementations
type RunnerFunc func(context.Context)
// Run bust be implemented by RunnerFunc to implements Runner
// @todo exaplin why this is a common go idiom
func (h RunnerFunc) Run(ctx context.Context) {
h(ctx)
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment