Created
March 21, 2017 08:12
-
-
Save simcap/c9722b3e735a12509e3d19b199ca9d8c to your computer and use it in GitHub Desktop.
Golang friendly console printers
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
| 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