mirror of
https://codeberg.org/scip/kleingebaeck.git
synced 2025-12-17 20:41:01 +01:00
fix linter errors (#23)
This commit is contained in:
10
config.go
10
config.go
@@ -97,12 +97,14 @@ func InitConfig() (*Config, error) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Load default values using the confmap provider.
|
// Load default values using the confmap provider.
|
||||||
k.Load(confmap.Provider(map[string]interface{}{
|
if err := k.Load(confmap.Provider(map[string]interface{}{
|
||||||
"template": template,
|
"template": template,
|
||||||
"outdir": ".",
|
"outdir": ".",
|
||||||
"loglevel": "notice",
|
"loglevel": "notice",
|
||||||
"userid": 0,
|
"userid": 0,
|
||||||
}, "."), nil)
|
}, "."), nil); err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
|
||||||
// setup custom usage
|
// setup custom usage
|
||||||
f := flag.NewFlagSet("config", flag.ContinueOnError)
|
f := flag.NewFlagSet("config", flag.ContinueOnError)
|
||||||
@@ -122,7 +124,9 @@ func InitConfig() (*Config, error) {
|
|||||||
f.BoolP("help", "h", false, "show usage")
|
f.BoolP("help", "h", false, "show usage")
|
||||||
f.BoolP("manual", "m", false, "show manual")
|
f.BoolP("manual", "m", false, "show manual")
|
||||||
|
|
||||||
f.Parse(os.Args[1:])
|
if err := f.Parse(os.Args[1:]); err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
|
||||||
// generate a list of config files to try to load, including the
|
// generate a list of config files to try to load, including the
|
||||||
// one provided via -c, if any
|
// one provided via -c, if any
|
||||||
|
|||||||
Reference in New Issue
Block a user