Standard library / fmt

fmt.Sprintln()

Returns default-formatted arguments separated by spaces, followed by a newline. Expected stdout: '"row 8\\n"\n'.

Formal Syntax & Structure

go syntaxgo
func Sprintln(a ...any) string

Parameters & Attributes

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

Return Value

string

Formatted text.

Working Example

Example Snippetgo
package main
import (  "fmt")
func main() {  fmt.Printf("%q\n", fmt.Sprintln("row", 8))}
Go Reference