Open
Description
When the program is running as Windows system services, the os.stdout is nil. which results in a panic.
panic: nil passed instead of *os.File to NewColorable()
goroutine 1 [running]:
github.com/mattn/go-colorable.NewColorable(0x0)
C:/Users/chen/go/pkg/mod/github.com/mattn/go-colorable@v0.1.13/colorable_windows.go:104 +0x3d6
github.com/mattn/go-colorable.NewColorableStdout()
C:/Users/chen/go/pkg/mod/github.com/mattn/go-colorable@v0.1.13/colorable_windows.go:122 +0x25
github.com/fatih/color.init()
C:/Users/chen/go/pkg/mod/github.com/fatih/color@v1.13.0/color.go:27 +0x12d
link issue: mattn/go-colorable#76
Maybe we need a method to avoid calling the go-colorable.NewColorableStdout()
when the os.Stdout is nil?
Metadata
Metadata
Assignees
Labels
No labels