vareval

package
v1.30.1 Latest Latest
Warning

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

Go to latest
Published: Nov 8, 2026 License: MIT Imports: 7 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package vareval evaluates the templates in vars, those of a workflow and those of a step. EvalValue evaluates one var, as a step evaluates each of its vars. Eval evaluates the vars of a workflow with it, each var after the vars it reads, so that a value such as random_str(8) is computed once, and reports a var that reads itself through others as a circular reference.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Eval

func Eval(written map[string]any, given map[string]string, env map[string]string) (map[string]any, error)

Eval evaluates the templates in the vars a workflow writes, with env, the environment variables, to read. A var can read another as vars.<name>; each one is evaluated after the vars it reads, so a value such as random_str(8) is computed once and every var that reads it sees the same value. A var whose template cannot be evaluated is an error, and so is a circular reference.

A var in given, which the person running the workflow gave, is not evaluated: it is the text given, whatever the workflow writes for it, and the vars that read it see that text. Neither written nor env is changed.

func EvalValue

func EvalValue(ev *expr.Expr, name string, v any, env any) (any, error)

EvalValue evaluates the templates in the var name, a workflow var or a step var, with ev and env: a string becomes a string, and a map or a list keeps the type of each value that is a single template. Other values are kept as they are. An error names the value that could not be evaluated, as vars.auth.user.

Types

This section is empty.

Jump to

Keyboard shortcuts

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