Fixing extensions
This commit is contained in:
parent
03272881c6
commit
4f6a93b1bb
6
main.go
6
main.go
@ -50,15 +50,15 @@ func parse(filename string) (*config, error) {
|
||||
|
||||
conf := &config{}
|
||||
switch path.Ext(filename) {
|
||||
case "json":
|
||||
case ".json":
|
||||
if err := json.Unmarshal(bytes, &conf); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
case "toml":
|
||||
case ".toml":
|
||||
if err := toml.Unmarshal(bytes, &conf); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
case "yaml":
|
||||
case ".yaml":
|
||||
if err := yaml.Unmarshal(bytes, &conf); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user