Errors and Limits#

Errors#

Use errors.Is with these sentinels:

SentinelRaised for
ErrSyntaxInvalid syntax, with the character offset of the error in the source
ErrFunctionUnknown function names and incorrect argument counts
ErrTypeOperands, receivers, indexes, keys, or arguments of the wrong type
ErrMissingOrdinary access to a missing property, value, or index
ErrArithmeticDivision by zero and non-finite results
ErrLimitParsing or compilation limits exceeded

Compilation can fail on a type error in an unused branch. See type checking.

Limits#

Expressions may nest up to 256 levels. Each binary operator adds a level, but array elements, object members, case arms, and pipeline stages do not. Exceeding the limit raises ErrLimit.

Parenthesize pipelines used as case conditions if ambiguous colons cause ErrLimit.

Input maps and arrays must not contain cycles.