std / fmt

fmt

import "std:fmt"

Provides string formatting functionality with printf-style format specifiers. Includes functions for formatting to buffers (Formatf, Format, Formatln) and printing to stdout (Printf, Print, Println).

View source on Codeberg →

Types

#
type Buffer list[byte]

A type alias for a dynamic byte array. Caller owns and manages the buffer's memory.

Buffer Formatting

#
func Formatf(buf Buffer, format string, args ...any)

Formats according to format specifier and appends the result to the buffer.

#
func Format(buf Buffer, args ...any)

Appends string representation of arguments (space-separated) to the buffer.

#
func Formatln(buf Buffer, args ...any)

Appends string representation of arguments with trailing newline to the buffer.

Standard Output

#
func Printf(format string, args ...any)

Formats according to format specifier and writes to stdout.

#
func Print(args ...any)

Writes string representation of arguments (space-separated) to stdout.

#
func Println(args ...any)

Writes string representation of arguments with trailing newline to stdout.