Documentation
¶
Overview ¶
Package fmt provides the importable `fmt` module. Its implementation now lives in the root gad package as the builtin `fmt` namespace; this package re-exports it so import("fmt") keeps working.
Example ¶
exampleRun(`
fmt := import("fmt")
fmt.print("print_")
fmt.println("line")
fmt.println("a", "b", 3)
fmt.printf("%v\n", [1, 2])
fmt.println(fmt.sprint("x", "y", 4))
a1 := fmt.scanArg("str")
a2 := fmt.scanArg("int")
r := fmt.sscanf("abc 123", "%s%d", a1, a2)
fmt.println(r)
fmt.println(bool(a1), a1.Value)
fmt.println(bool(a2), a2.Value)
`)
Output: print_line a b 3 [1, 2] xy4 2 true abc true 123
Index ¶
Examples ¶
Constants ¶
View Source
const ModuleName = "fmt"
Variables ¶
View Source
var ModuleInit = gad.ModuleInitFunc(func(module *gad.Module, c gad.Call) (err error) { module.Data = gad.FmtModule() return })
ModuleInit represents fmt module.
Functions ¶
This section is empty.
Types ¶
type ScanArg ¶
type ScanArg = gad.FmtScanArg
ScanArg is the interface implemented by the scan-argument objects returned by fmt.ScanArg.
Click to show internal directories.
Click to hide internal directories.