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:
Ciro S. Costa 2020-02-25 14:26:26 -05:00
parent 1ae69250ce
commit bea76f65e0
1 changed files with 2 additions and 2 deletions

View File

@ -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 {