-
-
Notifications
You must be signed in to change notification settings - Fork 97
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Panic while a program is runing as windows system service #76
Comments
NewColorable does not accept nil. On Windows NT Service, os.Stdout always be nil. Can you avoid to use fatih/color in your code? |
Or, you can avoid this with below color.Output = io.Discard
color.Error = io.Discard |
make sense, I will try to reach out to the faith/color project to see what could be done on their side.
Thanks for your tips. but where should I put those codes on? since it happened on the go init procedure. |
It should be at init func. func init() {
if os.Stdout == nil {
color.Output = io.Discard
color.Error = io.Discard
}
} |
It looks like the os.Stdout may be nil in this case.
It would be better if we could have a method to get around this panic.
The text was updated successfully, but these errors were encountered: