fmt.Printf

The fmt function that prints text built from a format string, in which verbs such as %s and %d are replaced by the arguments.

In more detail

Printf does not add a new line; end the format with \n. The verbs must match the argument types, and go vet warns when they do not. Use it when you want control over the layout of a line.

Example

fmt.Printf("host %s port %d\n", t.Host, t.Port)

Related terms

Taught in

References