testexpr

command
v3.9.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 6, 2026 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Overview

Command testexpr evaluates an expr-lang expression against a JSON environment and prints the result. Meant for local iteration on spec expressions, not for end users.

Usage:

go run ./cmd/testexpr <expression> [envJSON|@file|-]

The env arg defaults to "{}" when omitted. "-" reads JSON from stdin; "@file" reads it from a file; anything else is parsed as a literal JSON string. The expression is evaluated with the same helper functions (truncate, coalesce, epochMs, ...) available to spec expressions, injected via exprenv.BaseFuncs.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL