default to config.yaml
This commit is contained in:
parent
9009c4b07f
commit
3ea4cfcbf8
|
@ -119,17 +119,15 @@ func LoadConfig(configPath string) (*Config, error) {
|
|||
},
|
||||
}
|
||||
|
||||
if configPath != "" {
|
||||
f, err := os.Open(configPath)
|
||||
if err != nil {
|
||||
return nil, fmt.Errorf("failed to open config file: %v", err)
|
||||
}
|
||||
defer f.Close()
|
||||
f, err := os.Open(configPath)
|
||||
if err != nil {
|
||||
return nil, fmt.Errorf("failed to open config file: %v", err)
|
||||
}
|
||||
defer f.Close()
|
||||
|
||||
d := yaml.NewDecoder(f)
|
||||
if err := d.Decode(config); err != nil {
|
||||
return nil, fmt.Errorf("failed to parse config file: %v", err)
|
||||
}
|
||||
d := yaml.NewDecoder(f)
|
||||
if err := d.Decode(config); err != nil {
|
||||
return nil, fmt.Errorf("failed to parse config file: %v", err)
|
||||
}
|
||||
|
||||
// validate forge is set
|
||||
|
|
2
main.go
2
main.go
|
@ -16,7 +16,7 @@ import (
|
|||
)
|
||||
|
||||
func main() {
|
||||
configPath := flag.String("config", "", "The config file")
|
||||
configPath := flag.String("config", "config.yaml", "The config file")
|
||||
mountoptionsFlag := flag.String("o", "", "Filesystem mount options. See mount.fuse(8)")
|
||||
debug := flag.Bool("debug", false, "Enable debug logging")
|
||||
|
||||
|
|
Loading…
Reference in New Issue