STRING::ERRORF 1g 2024-03-01 laplante@plcb.ca GOWEB/STRING — Formatted Error Output


title: “string::errorf” Version:“1.0.0” Date: “2024-03-01 ” Author: “laplante@plcb.ca”
section: “1g”

Module: “GOWEB / STRING”

Name

string::errorf Formatted Error Output

Synopsis

string::errorf(format [, args])
errorf(format [, args])

Description

The errorf function is equivalent to Go’s printf, with the output directed as follows:

Formatting follows Go’s fmt.Printf conventions and supports the following verbs:


General


Boolean


Integer


Floating-Point and Complex


String


Pointer


Defaults for %!v(MISSING)


Width and Precision

Width is specified by a decimal number before the verb.
Precision follows a period (.). Examples:

Width and precision can be replaced by * to read the value from the next operand (type int).


Notes


Flags


Examples

res={{
    a := [1, 2.2, "3"];
    errorf("%!T(MISSING) %!T(MISSING) %!T(MISSING)\n", a);
}};

Returns:

res = int64 float64 string

res={{
    a := [1, 2.2, "3", [1, 2, 3]];
    errorf("%!T(MISSING) %!T(MISSING) %!T(MISSING) %!T(MISSING)\n", a);
}};

Returns:

res = int64 float64 string int64
%!!(MISSING)(EXTRA int64=2, int64=3)

Author


See Also


Version History