all repos — homestead @ 2ea9b6cc0c1249f062d2d01c46a280c51f6b9769

Code for my website

Use errors.WithMessage in place of .Wrap

Alan Pearce
commit

2ea9b6cc0c1249f062d2d01c46a280c51f6b9769

parent

5c9eb456d14c37acfb1294425f607810ddebb302

1 file changed, 3 insertions(+), 3 deletions(-)

changed files
M internal/website/filemap.gointernal/website/filemap.go
@@ -35,12 +35,12 @@
func hashFile(filename string) (string, error) { f, err := os.Open(filename) if err != nil { - return "", errors.Wrapf(err, "could not open file %s for hashing", filename) + return "", errors.WithMessagef(err, "could not open file %s for hashing", filename) } defer f.Close() hash := fnv.New64a() if _, err := io.Copy(hash, f); err != nil { - return "", errors.Wrapf(err, "could not hash file %s", filename) + return "", errors.WithMessagef(err, "could not hash file %s", filename) } return fmt.Sprintf(`W/"%x"`, hash.Sum(nil)), nil
@@ -102,7 +102,7 @@
return nil }) if err != nil { - return errors.Wrap(err, "could not walk directory") + return errors.WithMessage(err, "could not walk directory") } return nil