| 1 | package colorscip-go gomod github.com/nicholas-fedor/shoutrrr . `github.com/nicholas-fedor/shoutrrr/pkg/color`/ |
| 2 | |
| 3 | import ( |
| 4 | "fmtscip-go gomod github.com/golang/go/src . fmt/" |
| 5 | "osscip-go gomod github.com/golang/go/src . os/" |
| 6 | "stringsscip-go gomod github.com/golang/go/src . strings/" |
| 7 | ) |
| 8 | |
| 9 | func boolPtrscip-go gomod github.com/nicholas-fedor/shoutrrr . `github.com/nicholas-fedor/shoutrrr/pkg/color`/boolPtr().(v bool) *bool { |
| 10 | return &v |
| 11 | } |
| 12 | |
| 13 | // noColorIsSet returns true if the NO_COLOR environment variable is set (regardless of value). |
| 14 | // This follows the NO_COLOR standard (https://no-color.org/) where the presence |
| 15 | // of the environment variable, with any value including empty, should disable colors. |
| 16 | func noColorIsSetscip-go gomod github.com/nicholas-fedor/shoutrrr . `github.com/nicholas-fedor/shoutrrr/pkg/color`/noColorIsSet().() bool { |
| 17 | _, exists := osscip-go gomod github.com/golang/go/src . os/.LookupEnvscip-go gomod github.com/golang/go/src . os/LookupEnv().("NO_COLOR") |
| 18 | |
| 19 | return exists |
| 20 | } |
| 21 | |
| 22 | // sprintln is a helper function to format a string with fmt.Sprintln and trim the trailing newline. |
| 23 | func sprintlnscip-go gomod github.com/nicholas-fedor/shoutrrr . `github.com/nicholas-fedor/shoutrrr/pkg/color`/sprintln().(a ...any) string { |
| 24 | return stringsscip-go gomod github.com/golang/go/src . strings/.TrimSuffixscip-go gomod github.com/golang/go/src . strings/TrimSuffix().(fmtscip-go gomod github.com/golang/go/src . fmt/.Sprintlnscip-go gomod github.com/golang/go/src . fmt/Sprintln().(a...), "\n") |
| 25 | } |