colours.go (457B)
1 package colours 2 3 const reset = "\033[0m" 4 const ( 5 Code_grey = -2 6 Code_red = -1 7 Code_yellow = 0 8 Code_green = 1 9 ) 10 11 func Bold(str string) string { 12 return "\033[1m" + str + reset 13 } 14 15 func Red(str string) string { 16 return "\033[31m" + str + reset 17 } 18 19 func Green(str string) string { 20 return "\033[32m" + str + reset 21 } 22 23 func Yellow(str string) string { 24 return "\033[33m" + str + reset 25 } 26 27 func Grey(str string) string { 28 return "\033[37m" + str + reset 29 }