Use errors.WithMessage in place of .Wrap
1 file changed, 2 insertions(+), 2 deletions(-)
changed files
M internal/builder/template.go → internal/builder/template.go
@@ -47,7 +47,7 @@ func NewDocumentFromReader(r io.Reader) (*QueryDocument, error) { doc, err := goquery.NewDocumentFromReader(r) - return &QueryDocument{doc}, errors.Wrap(err, "could not create query document") + return &QueryDocument{doc}, errors.WithMessage(err, "could not create query document") } func (q *QueryDocument) Find(selector string) *QuerySelection {@@ -148,7 +148,7 @@ return "", err } expr, err := xpath.CompileWithNS("//xhtml:style", nsMap) if err != nil { - return "", errors.Wrap(err, "could not parse XPath") + return "", errors.WithMessage(err, "could not parse XPath") } style := xmlquery.QuerySelector(doc, expr)