fix linter errors (#23)

This commit is contained in:
T.v.Dein
2023-12-23 22:51:50 +01:00
committed by GitHub
parent dc4d3d7f9c
commit c1cbce32e1

View File

@@ -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