shortcircuit

CUE v0.18.0

Surface: per-file @experiment(...) attribute

Enablement

@experiment(shortcircuit)

Lifecycle

preview since v0.17.0

Description

ShortCircuit enables short-circuit evaluation for the logical operators && and ||. When the result is fully determined by the left operand alone (false && ... or true || ...), the right operand is not evaluated and any error or incomplete value it carries is suppressed.

This matches the behavior documented in the CUE spec ("The right operand is evaluated conditionally") and is consistent with all mainstream languages.

Install CUE