fmt
The fmt module provides Go-style formatted printing and string formatting.
Functions¶
| Function | Returns | Description |
|---|---|---|
fmt.printf(format, *args) |
None |
Print formatted output to stdout |
fmt.println(*args) |
None |
Print arguments to stdout followed by a newline |
fmt.sprintf(format, *args) |
string |
Return a formatted string |
printf, println, and sprintf are also available as top-level global aliases (no fmt. prefix required).
Format strings use Go fmt verbs: %s (string), %d (integer), %f (float), %v (default), %q (quoted string), %% (literal percent), etc.