chore: move fmtErr global var

main
Tran Hau 2021-01-20 14:54:35 +07:00
parent 59c5aaa8d1
commit 0206b95bf0
1 changed files with 4 additions and 1 deletions

View File

@ -38,6 +38,10 @@ const (
debugFlag = "debug"
)
var (
fmtErr = color.New(color.FgRed)
)
func main() {
a := &action{}
@ -88,7 +92,6 @@ func main() {
if err := app.Run(os.Args); err != nil {
// Highlight error
fmtErr := color.New(color.FgRed)
fmtErr.Printf("[%s error]: ", appName)
fmt.Printf("%s\n", err.Error())
}