Go(Golang)教程之如何以下划线打印/输出文本

197 阅读1分钟

概述

我们可以使用信仰包来实现同样的目的

github.com/fatih/color

程序

package main

import (
	"github.com/fatih/color"
)

func main() {
	whilte := color.New(color.FgWhite)
	boldWhite := whilte.Add(color.Underline)
	boldWhite.Println("This will print text in underline")
}

输出