File: main.go

package info (click to toggle)
golang-github-pterm-pterm 0.12.79-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 3,640 kB
  • sloc: makefile: 4
file content (14 lines) | stat: -rw-r--r-- 507 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
package main

import "github.com/pterm/pterm"

func main() {
	// Print a default error message with PTerm's built-in Error style.
	pterm.Error.Println("This is the default Error")

	// Override the default error prefix with a new text and style.
	pterm.Error.Prefix = pterm.Prefix{Text: "OVERRIDE", Style: pterm.NewStyle(pterm.BgCyan, pterm.FgRed)}

	// Print the error message again, this time with the overridden prefix.
	pterm.Error.Println("This is the default Error after the prefix was overridden")
}