vars: use go std err wrapping
as we standardize on wrapping errors using `errors` (rather than `github.com/pkg/errors), we can also make our testing standard (using `errors.Is()` to check if we got a specific err in the chain). Signed-off-by: Ciro S. Costa <cscosta@pivotal.io>
This commit is contained in:
parent
1ae69250ce
commit
bea76f65e0
|
@ -1,13 +1,13 @@
|
|||
package vars
|
||||
|
||||
import (
|
||||
"errors"
|
||||
"fmt"
|
||||
"regexp"
|
||||
"sort"
|
||||
"strings"
|
||||
|
||||
"github.com/hashicorp/go-multierror"
|
||||
"github.com/pkg/errors"
|
||||
"gopkg.in/yaml.v2"
|
||||
)
|
||||
|
||||
|
@ -97,7 +97,7 @@ func (i interpolator) Interpolate(node interface{}, varsLookup varsLookup) (inte
|
|||
for _, name := range i.extractVarNames(typedNode) {
|
||||
foundVal, found, err := varsLookup.Get(name)
|
||||
if err != nil {
|
||||
return nil, errors.WithMessagef(err, "Finding variable '%s'", name)
|
||||
return nil, fmt.Errorf("var lookup '%s': %w", name, err)
|
||||
}
|
||||
|
||||
if found {
|
||||
|
|
Loading…
Reference in New Issue