-
Notifications
You must be signed in to change notification settings - Fork 49
Description
Problem Description
github.com/mattn/go-colorable provides a color‑aware writer for Windows consoles. The current build links this package into binaries even on non‑Windows platforms.
Impact
Including a Windows‑specific dependency on other operating systems unnecessarily inflates the binary size and can introduce platform‑specific code paths that are never exercised. It also suggests that the build logic may be relying on runtime.GOOS checks instead of proper OS build tags, leading to incorrect conditional compilation.
Suggested Solution
Guard the import of go-colorable with appropriate build tags so that it is compiled only for Windows targets. Refactor any runtime.GOOS conditionals to use OS‑specific files where feasible, ensuring the final binary for Linux, macOS, or other platforms does not contain the Windows colorable writer.