From bea76f65e07925e9d523d083bdc7ecee5975ccf5 Mon Sep 17 00:00:00 2001 From: "Ciro S. Costa" Date: Tue, 25 Feb 2020 14:26:26 -0500 Subject: [PATCH] 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 --- vars/template.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/vars/template.go b/vars/template.go index e98669059..a145484c8 100644 --- a/vars/template.go +++ b/vars/template.go @@ -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 {