Created
February 3, 2020 17:59
-
-
Save pyperanger/95d70d28ad9c0e653a7ff97dc4d54672 to your computer and use it in GitHub Desktop.
Golang colors without external library in Linux
This file contains 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 main | |
import ( | |
"fmt" | |
) | |
var ( | |
RED = "\x1b[31m" | |
GREEN = "\x1b[32m" | |
YELLOW = "\x1b[33m" | |
BLUE = "\x1b[34m" | |
MAGENTA = "\x1b[35m" | |
CYAN = "\x1b[36m" | |
) | |
func main() { | |
fmt.Println(RED, "RED", | |
GREEN, "GREEN", | |
YELLOW, "YELLOW", | |
BLUE, "BLUE", | |
MAGENTA, "MAGENTA", | |
CYAN, "CYAN"); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment