table
table copied to clipboard
Support for Colors on Windows
Hello,
Table works great on Windows, only problem is that color codes are implemented from Linux. So only thing that is needed is to check what OS are you using, and if Windows, you would use different color codes.
Actually Windows is supported pretty well, if you use an stdout wrapper like color.Output ( from https://github.com/fatih/color ) or colorable.NewColorableStdout() from https://github.com/mattn/go-colorable
You just pass them like table.New(color.Output)
or table.New(colorable.NewColorableStdout())
and both can detect the OS and do the appropriate windows magic.
In my experience, the former works slightly better.