mirror of
https://github.com/go-task/task.git
synced 2025-11-27 22:38:20 +02:00
feat: enforce gofumpt linter
This commit is contained in:
committed by
Andrey Nering
parent
aab51c331f
commit
09c9094a6b
@@ -8,27 +8,35 @@ import (
|
||||
"github.com/fatih/color"
|
||||
)
|
||||
|
||||
type Color func() PrintFunc
|
||||
type PrintFunc func(io.Writer, string, ...any)
|
||||
type (
|
||||
Color func() PrintFunc
|
||||
PrintFunc func(io.Writer, string, ...any)
|
||||
)
|
||||
|
||||
func Default() PrintFunc {
|
||||
return color.New(envColor("TASK_COLOR_RESET", color.Reset)).FprintfFunc()
|
||||
}
|
||||
|
||||
func Blue() PrintFunc {
|
||||
return color.New(envColor("TASK_COLOR_BLUE", color.FgBlue)).FprintfFunc()
|
||||
}
|
||||
|
||||
func Green() PrintFunc {
|
||||
return color.New(envColor("TASK_COLOR_GREEN", color.FgGreen)).FprintfFunc()
|
||||
}
|
||||
|
||||
func Cyan() PrintFunc {
|
||||
return color.New(envColor("TASK_COLOR_CYAN", color.FgCyan)).FprintfFunc()
|
||||
}
|
||||
|
||||
func Yellow() PrintFunc {
|
||||
return color.New(envColor("TASK_COLOR_YELLOW", color.FgYellow)).FprintfFunc()
|
||||
}
|
||||
|
||||
func Magenta() PrintFunc {
|
||||
return color.New(envColor("TASK_COLOR_MAGENTA", color.FgMagenta)).FprintfFunc()
|
||||
}
|
||||
|
||||
func Red() PrintFunc {
|
||||
return color.New(envColor("TASK_COLOR_RED", color.FgRed)).FprintfFunc()
|
||||
}
|
||||
@@ -41,7 +49,6 @@ func envColor(env string, defaultColor color.Attribute) color.Attribute {
|
||||
override, err := strconv.Atoi(os.Getenv(env))
|
||||
if err == nil {
|
||||
return color.Attribute(override)
|
||||
|
||||
}
|
||||
return defaultColor
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user