github.com/gettyimages/terraform@v0.7.6-0.20161219132226-dc052c5707a3/terraform/eval_sequence.go (about)

     1  package terraform
     2  
     3  // EvalSequence is an EvalNode that evaluates in sequence.
     4  type EvalSequence struct {
     5  	Nodes []EvalNode
     6  }
     7  
     8  func (n *EvalSequence) Eval(ctx EvalContext) (interface{}, error) {
     9  	for _, n := range n.Nodes {
    10  		if _, err := EvalRaw(n, ctx); err != nil {
    11  			return nil, err
    12  		}
    13  	}
    14  
    15  	return nil, nil
    16  }
    17  
    18  // EvalNodeFilterable impl.
    19  func (n *EvalSequence) Filter(fn EvalNodeFilterFunc) {
    20  	for i, node := range n.Nodes {
    21  		n.Nodes[i] = fn(node)
    22  	}
    23  }