fmt

The Go standard library package for formatted input and output, such as printing text with fmt.Println and fmt.Printf.

In more detail

Its print functions come in families: Print writes to standard output, Sprint returns a string, and Fprint writes to any io.Writer such as os.Stderr. The f versions take a format string with verbs such as %s and %d. fmt.Errorf builds error values the same way.

Example

import "fmt"

Related terms

Taught in

References