MCPcopy Create free account
hub / github.com/Hidden-Node/GooseRelayVPN-AndroidClient / shouldUseColor

Function shouldUseColor

cmd/client/color.go:5–24  ·  view source on GitHub ↗
(out *os.File)

Source from the content-addressed store, hash-verified

3import "os"
4
5func shouldUseColor(out *os.File) bool {
6 if os.Getenv("NO_COLOR") != "" {
7 return false
8 }
9
10 if force := os.Getenv("FORCE_COLOR"); force != "" && force != "0" {
11 return true
12 }
13
14 info, err := out.Stat()
15 if err != nil {
16 return false
17 }
18
19 if info.Mode()&os.ModeCharDevice == 0 {
20 return false
21 }
22
23 return platformColorSupported(out)
24}

Callers 1

setupClientLoggingFunction · 0.85

Calls 1

platformColorSupportedFunction · 0.70

Tested by

no test coverage detected