Skip to content

Commit a1b8944

Browse files
authored
fix: use %w for errors (#303)
Signed-off-by: Chris Gianelloni <[email protected]>
1 parent 573b544 commit a1b8944

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
@@ -110,19 +110,19 @@ func Load(configFile string) (*Config, error) {
110110
if configFile != "" {
111111
buf, err := os.ReadFile(configFile)
112112
if err != nil {
113-
return nil, fmt.Errorf("error reading config file: %s", err)
113+
return nil, fmt.Errorf("error reading config file: %w", err)
114114
}
115115
err = yaml.Unmarshal(buf, globalConfig)
116116
if err != nil {
117-
return nil, fmt.Errorf("error parsing config file: %s", err)
117+
return nil, fmt.Errorf("error parsing config file: %w", err)
118118
}
119119
}
120120
// Load config values from environment variables
121121
// We use "dummy" as the app name here to (mostly) prevent picking up env
122122
// vars that we hadn't explicitly specified in annotations above
123123
err := envconfig.Process("dummy", globalConfig)
124124
if err != nil {
125-
return nil, fmt.Errorf("error processing environment: %s", err)
125+
return nil, fmt.Errorf("error processing environment: %w", err)
126126
}
127127
// Check profiles
128128
availableProfiles := GetAvailableProfiles()

0 commit comments

Comments
 (0)