Skip to content

Commit dfed24e

Browse files
committed
env var err should be returned
Currently, if the computeVar() call rturns an err it's lost. The actual 'return value, err' line cannot return an error ever, because the err value is tested above the computeVar() call in line 150 and would have returned already. With this patch the env var computeVar() err is returned correctly.
1 parent 79f0cd1 commit dfed24e

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

type.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -152,7 +152,7 @@ func (c *Config) String(section string, option string) (value string, err error)
152152
}
153153

154154
// $ environment variables
155-
computedVal, _ = c.computeVar(&value, envVarRegExp, 2, 1, func(varName *string) string {
155+
computedVal, err = c.computeVar(&value, envVarRegExp, 2, 1, func(varName *string) string {
156156
return os.Getenv(*varName)
157157
})
158158
value = *computedVal

0 commit comments

Comments
 (0)