MCPcopy Create free account
hub / github.com/Mrs4s/six-cli / LoadConfig

Function LoadConfig

models/config.go:27–38  ·  view source on GitHub ↗
(file string)

Source from the content-addressed store, hash-verified

25)
26
27func LoadConfig(file string) *Config {
28 bytes, err := ioutil.ReadFile(file)
29 if err != nil {
30 log.Fatalln("failed to read config: " + err.Error())
31 }
32 var conf Config
33 err = json.Unmarshal(bytes, &conf)
34 if err != nil {
35 log.Fatalln("failed to decode config: " + err.Error())
36 }
37 return &conf
38}
39
40func (conf *Config) SaveFile(file string) {
41 bytes, err := json.Marshal(conf)

Callers 1

mainFunction · 0.92

Calls

no outgoing calls

Tested by

no test coverage detected