Skip to content

Instantly share code, notes, and snippets.

@dgrijalva
Created April 20, 2016 01:07
Show Gist options
  • Save dgrijalva/4add2e545b7cf84e8b6d42f38fc66841 to your computer and use it in GitHub Desktop.
Save dgrijalva/4add2e545b7cf84e8b6d42f38fc66841 to your computer and use it in GitHub Desktop.
The function I copy/paste into every go command line tool
// Like printf, but then it dies
func fatal(msg string, more ...interface{}) {
fmt.Fprintf(os.Stderr, msg+"\n", more...)
os.Exit(1)
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment