add: code commenting

This commit is contained in:
marcello 2020-01-05 15:07:34 -06:00
parent 9ec0d1b676
commit 64ff1d551c

View File

@ -13,12 +13,17 @@ import (
) )
const ( const (
// RESET is the shell code to disable output color
RESET = "\033[0m" RESET = "\033[0m"
// CYAN is the shell code for CYAN output color
CYAN = "\033[36;1m" CYAN = "\033[36;1m"
// MAGENTA is the shell code for MAGENTA output color
MAGENTA = "\033[35m" MAGENTA = "\033[35m"
// RED is the shell code for RED output color
RED = "\033[36;31m" RED = "\033[36;31m"
// REDBOLD is the shell code for REDBOLD output color
REDBOLD = "\033[31;1m" REDBOLD = "\033[31;1m"
// YELLOW is the shell code for YELLOW output color
YELLOW = "\033[33m" YELLOW = "\033[33m"
) )
@ -43,6 +48,7 @@ func isPrintable(s string) bool {
return true return true
} }
// NoColor checks for environment if color should be enabled
func NoColor() bool { func NoColor() bool {
// https://no-color.org/ // https://no-color.org/
return os.Getenv("NO_COLOR") != "" return os.Getenv("NO_COLOR") != ""