Skip to content

Instantly share code, notes, and snippets.

@rolaveric
Created March 2, 2014 06:57
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save rolaveric/9302960 to your computer and use it in GitHub Desktop.
Save rolaveric/9302960 to your computer and use it in GitHub Desktop.
An example of a function type in Go
func DoSomething(callback func(message string) error) {
// Good thing I know this function will take a message string and return a single error response
err := callback("Did something good!")
if err != nil {
panic(err)
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment