Welcome To Golang By Example

Print/Output text in italic in Go (Golang)

Table of Contents

Overview

We can use the faith package to achieve the same

https://github.com/fatih/color

Program

package main

import (
	"fmt"

	"github.com/fatih/color"
)

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

Output