Files
xlgo-core/console/console_unix.go
T
杭州明婳科技 2dfcbbbb22 init
2026-04-30 23:26:14 +08:00

16 lines
315 B
Go

//go:build linux || darwin
package console
import (
"fmt"
)
// printColor 彩色打印(使用ANSI转义序列)
func (c *Console) printColor(code, msg string) {
// \033[ 是ANSI转义序列起始
// %sm 是颜色代码
// \033[0m 是重置颜色
fmt.Fprintf(c.output, "\033[%sm%s\033[0m\n", code, msg)
}