fmt is Go’s standard-library package for formatting and outputting data. Import it to make functions such as fmt.Println available in a program. section 2.1.1
fmt.Println writes to standard output, displays integers and Boolean values in human-readable form, and provides a convenient option for cheap debugging. section 2.1.1
Print a greeting
Import fmt in a main package and call fmt.Println("Hello world") to write a line to standard output. section 2.1.1
Listing 2.1 main.go
package main
import "fmt"
func main() {
fmt.Println("Hello world")
}
Runnable main.go example showing the fmt import and a fmt.Println call. section 2.1.1


