STRING::GENERRORF 1g 2024-12-22 laplante@plcb.ca GOWEB/STRING — Formatted Error Generation


title: “STRING::GENERRORF” version: “1.0.0” date: 2024-12-22 author: “laplante@plcb.ca” section: “1g” category: “GOWEB/STRING”


Name

string::generrof Formatted Error Generation

Synopsis

string::generrorf(format[, args])
generrorf(format[, args])
string::genErrorf(format[, args])
genErrorf(format[, args])

Description

generrorf generates an error message based on a format string and optional arguments, similar to Go’s fmt.Printf formatting verbs.

It supports a wide variety of format verbs for values, types, numbers, strings, runes, pointers, widths, and precisions.


General Verbs


Boolean


Integer


Floating-Point & Complex


String


Pointer


Width & Precision


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

laplante@plcb.ca

See Also


Version