fmt.Println
The fmt function that prints its arguments to standard output separated by spaces and followed by a new line.
In more detail
It is the quickest way to show values while learning. It formats each value in its default form, like the %v verb. It returns the number of bytes written and an error, which programs usually ignore for terminal output.
Example
fmt.Println("checking one host")Related terms
- fmt — The Go standard library package for formatted input and output, such as printing text with fmt.Println and fmt.Printf.
- 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.
- standard output and standard error — The two channels a program writes normal output (stdout) and error messages (stderr) to, plus stdin for input.
Taught in
- What Go Is and Why It Matters — Concurrent Systems Programming with Go
- Installing the Go Toolchain — Concurrent Systems Programming with Go
- Your First Program and go run — Concurrent Systems Programming with Go
- Variables, Typing, and Zero Values — Concurrent Systems Programming with Go
- Pointers and Memory — Concurrent Systems Programming with Go
- Arrays, Slices, and Maps — Concurrent Systems Programming with Go
- Structs and Methods — Concurrent Systems Programming with Go
- Interfaces and Why They Are Implicit — Concurrent Systems Programming with Go