-
Notifications
You must be signed in to change notification settings - Fork 32
chore: remove enableColor and colorize local variables #38
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
| } | ||
| val.Recursive.Self = val.Recursive // cycle | ||
|
|
||
| Dump(val) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm unsure why this one was there, maybe it something you forgot or wanted to keep, let me know
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It was for manual visual testing, which I'd prefer to keep in
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Generally looks good, looking forward to the fixes. Some comments on naming consistency mainly
godump.go
Outdated
| } | ||
|
|
||
| // format applies the configured formatter to the string with the given color code. | ||
| func (d *Dumper) format(code, str string) string { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
"format" is ambiguous and could have many implied meanings - I'd very much prefer to keep this as "colorize"
| } | ||
| return true | ||
| } | ||
|
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Doc comment
godump.go
Outdated
| // It defaults to [runtime.Caller], it is here to be overridden for testing purposes. | ||
| callerFn func(skip int) (uintptr, string, int, bool) | ||
|
|
||
| formatter Colorizer |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Similar here, colorizer
godump.go
Outdated
| // htmlColorize colorizes the string using HTML span tags. | ||
| func htmlColorize(code, str string) string { | ||
| // formatHTML colorizes the string using HTML span tags. | ||
| func formatHTML(code, str string) string { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
colorizeHTML
godump.go
Outdated
| return str | ||
| } | ||
| // formatANSIColor colorizes the string using ANSI escape codes. | ||
| func formatANSIColor(code, str string) string { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This adds Color as a qualifier to "format" as well when it could just be "colorizeANSI"
godump.go
Outdated
|
|
||
| // colorize is the default colorizer function. | ||
| var colorize Colorizer = ansiColorize // default | ||
| func formatNoColor(code, str string) string { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
colorizeNone or colorizeUnstyled
f73a23d to
5d5f9cb
Compare
|
Could you review and merge ? I'm a bit afraid newly opened PR could cause too many conflicts if code keep diverging. Example: |
a624abb to
ce8de10
Compare
|
I hope this PR is merged soon, as I’ve also experienced race conditions. Thank you in advance to @ccoVeille and @Akkadius for addressing these issues. |
supersedes #23 and #24
Fix #34