MCPcopy Create free account
hub / github.com/CovenantSQL/CovenantSQL / loadConfig

Function loadConfig

sqlchain/observer/config.go:42–57  ·  view source on GitHub ↗
(path string)

Source from the content-addressed store, hash-verified

40}
41
42func loadConfig(path string) (config *Config, err error) {
43 var (
44 content []byte
45 wrapper = &configWrapper{}
46 )
47 if content, err = ioutil.ReadFile(path); err != nil {
48 log.WithError(err).Error("failed to read config file")
49 return
50 }
51 if err = yaml.Unmarshal(content, wrapper); err != nil {
52 log.WithError(err).Error("failed to unmarshal config file")
53 return
54 }
55 config = wrapper.Observer
56 return
57}

Callers 1

TestLoadConfigFunction · 0.70

Calls 3

WithErrorFunction · 0.92
ErrorMethod · 0.80
UnmarshalMethod · 0.80

Tested by 1

TestLoadConfigFunction · 0.56