Better Error Handling

This commit is contained in:
aditya-K2
2021-12-31 15:48:58 +05:30
parent f6800b0361
commit 719a659df6
2 changed files with 109 additions and 35 deletions

21
utils/colors.go Normal file
View File

@@ -0,0 +1,21 @@
package utils
import "fmt"
var (
COLORS map[string]string = map[string]string{
"RESET": "\033[0m",
"RED": "\033[31m",
"GREEN": "\033[32m",
"YELLOW": "\033[33m",
"BLUE": "\033[34m",
"PURPLE": "\033[35m",
"CYAN": "\033[36m",
"GRAY": "\033[37m",
"WHITE": "\033[97m",
}
)
func Print(color, text string) {
fmt.Print(COLORS[color] + text + COLORS["RESET"])
}