Standard library / fmt

fmt.Println()

Writes default-formatted arguments separated by spaces and adds a newline; returns bytes written and write error. Expected stdout: 'stock 4\n8 <nil>\n'.

Formal Syntax & Structure

go syntaxgo
func Println(a ...any) (n int, err error)

Parameters & Attributes

NameTypeDescription
a...anyValues consumed by formatting; may be empty.

Return Value

(n int, err error)

Number of bytes written and write error.

Working Example

Example Snippetgo
package main
import (  "fmt")
func main() {  n, e := fmt.Println("stock", 4)  fmt.Println(n, e)}
Go Reference