From d63a51667e64a44ca246322c13436a70c19b4596 Mon Sep 17 00:00:00 2001 From: Joonas Loppi Date: Wed, 12 Jul 2023 12:19:47 +0300 Subject: [PATCH] `encoding/jsonfile`: wrap inner error instead of operating at string level --- encoding/jsonfile/jsonfile.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/encoding/jsonfile/jsonfile.go b/encoding/jsonfile/jsonfile.go index 8719701..f33339d 100644 --- a/encoding/jsonfile/jsonfile.go +++ b/encoding/jsonfile/jsonfile.go @@ -26,7 +26,7 @@ func read(path string, data interface{}, unmarshal func(io.Reader, interface{}) defer file.Close() if err := unmarshal(file, data); err != nil { - return fmt.Errorf("%s: %s", path, err.Error()) + return fmt.Errorf("%s: %w", path, err) } return nil