Go实现Windows彩色命令行输出
对于在命令行中彩色输出,Go本身没有提供直接系统层次的API调用封装,不过提供了调用系统API的包Syscall,然后我们使用它调用SetConsoleTextAttribute来进行色彩设置。
func ColorPrintln(s string, i int) { kernel32[......]
携书如历三千世, 无书唯度一平生。
对于在命令行中彩色输出,Go本身没有提供直接系统层次的API调用封装,不过提供了调用系统API的包Syscall,然后我们使用它调用SetConsoleTextAttribute来进行色彩设置。
func ColorPrintln(s string, i int) { kernel32[......]