go/src/fmt/example_test.go

// The Errorf function lets us use formatting features
// to create descriptive error messages.
func ExampleErrorf() {}

func ExampleFscanf() {}

func ExampleFscanln() {}

func ExampleSscanf() {}

func ExamplePrint() {}

func ExamplePrintln() {}

func ExamplePrintf() {}

func ExampleSprint() {}

func ExampleSprintln() {}

func ExampleSprintf() {}

func ExampleFprint() {}

func ExampleFprintln() {}

func ExampleFprintf() {}

// Print, Println, and Printf lay out their arguments differently. In this example
// we can compare their behaviors. Println always adds blanks between the items it
// prints, while Print adds blanks only between non-string arguments and Printf
// does exactly what it is told.
// Sprint, Sprintln, Sprintf, Fprint, Fprintln, and Fprintf behave the same as
// their corresponding Print, Println, and Printf functions shown here.
func Example_printers() {}

// These examples demonstrate the basics of printing using a format string. Printf,
// Sprintf, and Fprintf all take a format string that specifies how to format the
// subsequent arguments. For example, %d (we call that a 'verb') says to print the
// corresponding argument, which must be an integer (or something containing an
// integer, such as a slice of ints) in decimal. The verb %v ('v' for 'value')
// always formats the argument in its default form, just how Print or Println would
// show it. The special verb %T ('T' for 'Type') prints the type of the argument
// rather than its value. The examples are not exhaustive; see the package comment
// for all the details.
func Example_formats() {}