LoadMap loads map object from file. suffix of filepath will be used as file type. currently, json and yaml is supported
(filePath string)
| 88 | //LoadMap loads map object from file. suffix of filepath will be |
| 89 | // used as file type. currently, json and yaml is supported |
| 90 | func LoadMap(filePath string) (map[string]interface{}, error) { |
| 91 | data, err := LoadFile(filePath) |
| 92 | if err != nil { |
| 93 | return nil, err |
| 94 | } |
| 95 | d, ok := data.(map[string]interface{}) |
| 96 | if !ok { |
| 97 | return nil, fmt.Errorf("data isn't map") |
| 98 | } |
| 99 | return d, nil |
| 100 | } |
| 101 | |
| 102 | //LoadFile loads object from file. suffix of filepath will be |
| 103 | // used as file type. currently, json and yaml is supported |