github.com/vtorhonen/terraform@v0.9.0-beta2.0.20170307220345-5d894e4ffda7/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 n == nil {
    11  			continue
    12  		}
    13  
    14  		if _, err := EvalRaw(n, ctx); err != nil {
    15  			return nil, err
    16  		}
    17  	}
    18  
    19  	return nil, nil
    20  }
    21  
    22  // EvalNodeFilterable impl.
    23  func (n *EvalSequence) Filter(fn EvalNodeFilterFunc) {
    24  	for i, node := range n.Nodes {
    25  		n.Nodes[i] = fn(node)
    26  	}
    27  }