Standard library / fmt
fmt.Sprint()
Returns default-formatted arguments as a string without writing to stdout or adding a newline. Spaces are inserted between adjacent non-string operands. Expected stdout: '2 3\n'.
Formal Syntax & Structure
go syntaxgo
func Sprint(a ...any) stringParameters & Attributes
| Name | Type | Description |
|---|---|---|
| a | ...any | Values consumed by formatting; may be empty. |
Return Value
string
Formatted text.
Working Example
Example Snippetgo
package main
import ( "fmt")
func main() { fmt.Println(fmt.Sprint(2, 3))}