Skip to content

Commit f1bb16e

Browse files
committed
Don't return errors.Wrap() directly if the error could be nil
1 parent b6cf4d4 commit f1bb16e

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

config/config.go

+5-1
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,11 @@ func FromEnv(v Validator, options EnvOptions) error {
7070
return errors.Wrap(err, "can't parse environment variables")
7171
}
7272

73-
return errors.Wrap(v.Validate(), "invalid configuration")
73+
if err := v.Validate(); err != nil {
74+
return errors.Wrap(err, "invalid configuration")
75+
}
76+
77+
return nil
7478
}
7579

7680
// ParseFlags parses CLI flags and stores the result

0 commit comments

Comments
 (0)