Skip to content

Instantly share code, notes, and snippets.

@simcap
Created March 21, 2017 08:12
Show Gist options
  • Select an option

  • Save simcap/c9722b3e735a12509e3d19b199ca9d8c to your computer and use it in GitHub Desktop.

Select an option

Save simcap/c9722b3e735a12509e3d19b199ca9d8c to your computer and use it in GitHub Desktop.
Golang friendly console printers
func printOk(s string, a ...interface{}) {
fmt.Printf("\033[32m[OK]\033[m %s\n", fmt.Sprintf(s, a...))
}
func printKo(s string, a ...interface{}) {
fmt.Fprintf(os.Stderr, "\033[31m[KO]\033[m %s\n", fmt.Sprintf(s, a...))
}
func printInfo(s string, a ...interface{}) {
fmt.Printf("[+] %s\n", fmt.Sprintf(s, a...))
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment