-
Notifications
You must be signed in to change notification settings - Fork 53
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
add colour syntax highlighting (quick hack) #32
Conversation
Thanks, I like it! I'm not sure the extra dependencies are a problem. @simen? |
Any progress? 😃 |
func DumpColor(value ...interface{}) { | ||
result := (&Config).Sdump(value...) | ||
if err := quick.Highlight(os.Stdout, result, "go", "terminal256", "monokai"); err != nil { | ||
os.Stdout.Write([]byte("[syntax highlight error: " + err.Error() + "]")) | ||
} | ||
} | ||
|
||
// Dump a value to stdout in colour | ||
func DumpColour(value ...interface{}) { |
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 two function names are kind of confusing.
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.
There are two spellings of colour/color, depending on where in the world you are. (I'm in Australia, we have a "u").
I am very opposed to adding this large dependency for something that:
|
@icholy Yes, I agree. We could make a new module, though, e.g. |
How can you do it outside the package and yet keep it really useful?
It simply makes it easy and fast to read. A huge UX improvement |
I don't think you want to just merge this (it adds a bunch of dependencies, and you could do separately), but im adding just in case youre interested. (cc: #27 )