blob: adb2e4dd3b46b7bdaa7b1e94b31a1b3a1b48581d (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
|
package toml
import (
"os"
"dove/utils/collections"
"dove/utils/errors"
)
var loadedData collections.Record[string, any]
func LoadFile(filePath string) error {
fileContent, readError := os.ReadFile(filePath)
if readError != nil {
return errors.Error(ConfigFileReadFailed, filePath, readError.Error())
}
loadedData = make(collections.Record[string, any])
return unmarshalContent(fileContent, &loadedData)
}
|