fmt.Println()
Try it yourself →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
package main
import "fmt"
func main() {
fmt.Println("Hello", "World")
}Expected output
Hello World
When to use?
Showing results, debugging.
Common mistakes
- ⚠️ It will not compile without import "fmt".