Skip to content

Conversation

@SourLemonJuice
Copy link

@SourLemonJuice SourLemonJuice commented Sep 29, 2025

Redefine the ".noColor *bool" field to ".isNoColor bool" of type "Color", this removed the pointless pointer and reduced the complexity.
Which also removed the boolPtr() method(?)

The test "TestNoColor_Env" now removed, because the NO_COLOR env should not affect at runtime.

In my software, I want to force output through HTTP with color(client is curl), but each time New() will always use NO_COLOR env without any judgment, #71 can't work.
In the previous code, New() even will ignore the global NoColor status. This is confusion caused by the function's naming.

Redefine the ".noColor *bool" field to ".useColor bool" of type "Color",
this removed the pointless pointer and reduced the complexity.
Which also removed the boolPtr() method(?)

The test "TestNoColor_Env" now removed, because the NO_COLOR env should
not affect at runtime.
SourLemonJuice added a commit to SourLemonJuice/ipapi-agent that referenced this pull request Sep 29, 2025
Replace fatih/color with my fork version, which fixes the force color
output issue. PR: fatih/color#267
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant