Created
December 31, 2014 10:47
-
-
Save hirokazumiyaji/63efae5400671ac17f4b to your computer and use it in GitHub Desktop.
Color Print
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
package colorprint | |
import fmt | |
func Red(format string, a ...interface{}) { | |
fmt.Println("\x1b[31;1m%s\x1b[0m\n", fmt.Sprintf(format, a...)) | |
} | |
func Green(format string, a ...interface{}) { | |
fmt.Println("\x1b[32;1m%s\x1b[0m\n", fmt.Sprintf(format, a...)) | |
} | |
func Yellow(format string, a ...interface{}) { | |
fmt.Println("\x1b[33;1m%s\x1b[0m\n", fmt.Sprintf(format, a...)) | |
} | |
func Blue(format string, a ...interface{}) { | |
fmt.Println("\x1b[34;1m%s\x1b[0m\n", fmt.Sprintf(format, a...)) | |
} | |
func Magenta(format string, a ...interface{}) { | |
fmt.Println("\x1b[35;1m%s\x1b[0m\n", fmt.Sprintf(format, a...)) | |
} | |
func Cyan(format string, a ...interface{}) { | |
fmt.Println("\x1b[36;1m%s\x1b[0m\n", fmt.Sprintf(format, a...)) | |
} | |
func White(format string, a ...interface{}) { | |
fmt.Println("\x1b[37;1m%s\x1b[0m\n", fmt.Sprintf(format, a...)) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment