fmt.Println()
Prints values, adds a newline at the end.
Syntax
fmt.Println(value...)
Description
It is in the fmt package (requires import "fmt"). Prints multiple values separated by spaces and moves to the next line.
Example
Loading editor…
Expected output
Hello World
When to use?
Showing results, debugging.
Common mistakes
- ⚠️ It will not compile without import "fmt".