MCPcopy
hub / github.com/purpleidea/mgmt / StmtIf

Struct StmtIf

lang/ast/structs.go:3263–3272  ·  view source on GitHub ↗

StmtIf represents an if condition that contains between one and two branches of statements to be executed based on the evaluation of the boolean condition over time. In particular, this is different from an ExprIf which returns a value, where as this produces some Output. Normally if one of the bran

Source from the content-addressed store, hash-verified

3261// optional, it is the else branch, although this struct allows either to be
3262// optional, even if it is not commonly used.
3263type StmtIf struct {
3264 interfaces.Textarea
3265
3266 data *interfaces.Data
3267
3268 Condition interfaces.Expr
3269 conditionPtr interfaces.Func // ptr for table lookup
3270 ThenBranch interfaces.Stmt // optional, but usually present
3271 ElseBranch interfaces.Stmt // optional
3272}
3273
3274// String returns a short representation of this statement.
3275func (obj *StmtIf) String() string {

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected