]> git.immae.eu Git - github/fretlink/terraform-provider-statuscake.git/blobdiff - vendor/github.com/hashicorp/terraform/dag/dag.go
Upgrade to 0.12
[github/fretlink/terraform-provider-statuscake.git] / vendor / github.com / hashicorp / terraform / dag / dag.go
index b7eb10c335491b5100b9f09b79868170c6945a98..77c67eff9f25fcc25c5d319693c79c6bfde21392 100644 (file)
@@ -5,6 +5,8 @@ import (
        "sort"
        "strings"
 
+       "github.com/hashicorp/terraform/tfdiags"
+
        "github.com/hashicorp/go-multierror"
 )
 
@@ -15,7 +17,7 @@ type AcyclicGraph struct {
 }
 
 // WalkFunc is the callback used for walking the graph.
-type WalkFunc func(Vertex) error
+type WalkFunc func(Vertex) tfdiags.Diagnostics
 
 // DepthWalkFunc is a walk function that also receives the current depth of the
 // walk as an argument
@@ -161,9 +163,9 @@ func (g *AcyclicGraph) Cycles() [][]Vertex {
 }
 
 // Walk walks the graph, calling your callback as each node is visited.
-// This will walk nodes in parallel if it can. Because the walk is done
-// in parallel, the error returned will be a multierror.
-func (g *AcyclicGraph) Walk(cb WalkFunc) error {
+// This will walk nodes in parallel if it can. The resulting diagnostics
+// contains problems from all graphs visited, in no particular order.
+func (g *AcyclicGraph) Walk(cb WalkFunc) tfdiags.Diagnostics {
        defer g.debug.BeginOperation(typeWalk, "").End("")
 
        w := &Walker{Callback: cb, Reverse: true}