πForce-Statements
Force-Statement Syntax
A force-statement evaluates the expr
between force
and with
. It must evaluate to (..., error)
.
If
error != nil
:The program will panic with the
expr
to the right ofwith
If
error == nil
:expression between
try
andwith
will be destructured intosuccessVar
andfailureVar
Working Example
Last updated