Syntax

Go Print Output Syntax

In Go, print output: prints a formatted line — fmt.Println("Hello") fmt.Printf("%d\n", n)

Quick Answer

Syntax
fmt.Println("Hello") fmt.Printf("%d\n", n)
GoSyntax

Print Output

Code example
fmt.Println("Hello") fmt.Printf("%d\n", n)

Prints a formatted line.

Learn More

How to print output in Go

  1. Open your Go file or editor.
  2. Copy the example, then replace its sample names and values for your code.

Go Print Output Syntax

Use fmt.Println("Hello") fmt.Printf("%d\n", n).

Related Syntax References

Frequently asked questions

What is the Go syntax for print output?

Use this pattern: fmt.Println("Hello") fmt.Printf("%d\n", n)

Can I copy this Go code example?

Yes. Use Copy code and adapt the example to your program.

Is this Go syntax different on Mac or Windows?

No. The language syntax is the same across operating systems.

Official source · How we verify