From 2d1da489d889ee8385804674326cf8b0113cb859 Mon Sep 17 00:00:00 2001 From: Nate Sales Date: Mon, 10 Oct 2022 14:11:30 -0400 Subject: [PATCH] fix: disable color output if NO_COLOR env var is set Closes: #37 --- main.go | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/main.go b/main.go index 946c656..a4e6b37 100644 --- a/main.go +++ b/main.go @@ -179,6 +179,12 @@ func clearOpts() { if fileInfo, _ := os.Stdout.Stat(); (fileInfo.Mode() & os.ModeCharDevice) != 0 { opts.Color = true } + + // Disable color output if NO_COLOR env var is set + if os.Getenv("NO_COLOR") != "" { + log.Debug("NO_COLOR set") + opts.Color = false + } } // tlsVersion returns a TLS version number by given protocol string