Skip to content

Commit 9b1471b

Browse files
authored
fix: use %w in errors (#196)
Signed-off-by: Chris Gianelloni <[email protected]>
1 parent e968e3f commit 9b1471b

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

internal/config/config.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -72,19 +72,19 @@ func Load(configFile string) (*Config, error) {
7272
if configFile != "" {
7373
buf, err := os.ReadFile(configFile)
7474
if err != nil {
75-
return nil, fmt.Errorf("error reading config file: %s", err)
75+
return nil, fmt.Errorf("error reading config file: %w", err)
7676
}
7777
err = yaml.Unmarshal(buf, globalConfig)
7878
if err != nil {
79-
return nil, fmt.Errorf("error parsing config file: %s", err)
79+
return nil, fmt.Errorf("error parsing config file: %w", err)
8080
}
8181
}
8282
// Load config values from environment variables
8383
// We use "dummy" as the app name here to (mostly) prevent picking up env
8484
// vars that we hadn't explicitly specified in annotations above
8585
err := envconfig.Process("dummy", globalConfig)
8686
if err != nil {
87-
return nil, fmt.Errorf("error processing environment: %s", err)
87+
return nil, fmt.Errorf("error processing environment: %w", err)
8888
}
8989
return globalConfig, nil
9090
}

0 commit comments

Comments
 (0)