File tree Expand file tree Collapse file tree 1 file changed +4
-7
lines changed Expand file tree Collapse file tree 1 file changed +4
-7
lines changed Original file line number Diff line number Diff line change 1
1
package config
2
2
3
3
import (
4
- "errors"
5
4
"path"
6
5
"strings"
7
6
@@ -18,20 +17,18 @@ type Context struct {
18
17
}
19
18
20
19
func NewContext () * Context {
21
- return & Context {config .NewDefault (), "" }
20
+ return & Context {config : config .NewDefault ()}
22
21
}
23
22
24
23
func LoadContext (confName string , confPaths []string ) (* Context , error ) {
25
24
var err error
25
+ var conf * config.Config
26
26
for _ , confPath := range confPaths {
27
- conf , err : = config .ReadDefault (path .Join (confPath , confName ))
27
+ conf , err = config .ReadDefault (path .Join (confPath , confName ))
28
28
if err == nil {
29
- return & Context {conf , "" }, nil
29
+ return & Context {config : conf }, nil
30
30
}
31
31
}
32
- if err == nil {
33
- err = errors .New ("not found" )
34
- }
35
32
return nil , err
36
33
}
37
34
You can’t perform that action at this time.
0 commit comments