aboutsummaryrefslogtreecommitdiffstats
path: root/pkg/config
diff options
context:
space:
mode:
authorTaras Madan <tarasmadan@google.com>2023-07-21 11:54:11 +0200
committerTaras Madan <tarasmadan@google.com>2023-07-24 09:12:13 +0000
commit7549a7e1b57831cf6b08ce4700fc6e53417919f9 (patch)
tree8e027cdaf7abbc52a5fb29c37c7137dfd2122e7a /pkg/config
parentf7eecac8b446ef11cff4122de6f496ad5eaba3a9 (diff)
all: use special placeholder for errors
Diffstat (limited to 'pkg/config')
-rw-r--r--pkg/config/config.go4
1 files changed, 2 insertions, 2 deletions
diff --git a/pkg/config/config.go b/pkg/config/config.go
index 503a5b466..63c10213d 100644
--- a/pkg/config/config.go
+++ b/pkg/config/config.go
@@ -19,7 +19,7 @@ func LoadFile(filename string, cfg interface{}) error {
}
data, err := os.ReadFile(filename)
if err != nil {
- return fmt.Errorf("failed to read config file: %v", err)
+ return fmt.Errorf("failed to read config file: %w", err)
}
return LoadData(data, cfg)
}
@@ -30,7 +30,7 @@ func LoadData(data []byte, cfg interface{}) error {
dec := json.NewDecoder(bytes.NewReader(data))
dec.DisallowUnknownFields()
if err := dec.Decode(cfg); err != nil {
- return fmt.Errorf("failed to parse config file: %v", err)
+ return fmt.Errorf("failed to parse config file: %w", err)
}
return nil
}