cfmt

package
v1.4.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 24, 2021 License: MIT Imports: 5 Imported by: 39

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DisableColors added in v1.3.0

func DisableColors()

DisableColors globally disables colors. After parsing, no styles will be applied and the output will be clean text.

func EnableColors added in v1.3.0

func EnableColors()

EnableColors globally enables colors.

func Errorf added in v1.4.0

func Errorf(format string, a ...interface{}) error

Errorf is the same as fmt.Errorf.

func Fprint

func Fprint(w io.Writer, a ...interface{}) (n int, err error)

Fprint is the same as fmt.Fprint.

func Fprintf

func Fprintf(w io.Writer, format string, a ...interface{}) (n int, err error)

Fprintf is the same as fmt.Fprintf.

func Fprintln

func Fprintln(w io.Writer, a ...interface{}) (n int, err error)

Fprintln is the same as fmt.Fprintln.

func Print

func Print(a ...interface{}) (n int, err error)

Print is the same as fmt.Print.

func Printf

func Printf(format string, a ...interface{}) (n int, err error)

Printf is the same as fmt.Printf.

func Println

func Println(a ...interface{}) (n int, err error)

Println is the same as fmt.Println.

func RegisterStyle

func RegisterStyle(name string, fn func(string) string)

RegisterStyle registers a new custom style.

It will look like this:

  cfmt.RegisterStyle("code", func(s string) string {
	   return cfmt.Sprintf("{{%s}}::red|underline", s)
  })

The first argument is the name by which this style will be used, and the second is the styling function itself.

func Sprint

func Sprint(a ...interface{}) string

Sprint is the same as fmt.Sprint.

func Sprintf

func Sprintf(format string, a ...interface{}) string

Sprintf is the same as fmt.Sprintf.

func Sprintln

func Sprintln(a ...interface{}) string

Sprintln is the same as fmt.Sprintln.

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL