MCPcopy Create free account
hub / github.com/dlvhdr/diffnav / Load

Function Load

pkg/config/config.go:93–111  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

91}
92
93func Load() Config {
94 cfg := DefaultConfig()
95
96 configPath := getConfigFilePath()
97 if configPath == "" {
98 return cfg
99 }
100
101 data, err := os.ReadFile(configPath)
102 if err != nil {
103 return cfg
104 }
105
106 if err := yaml.Unmarshal(data, &cfg); err != nil {
107 return DefaultConfig()
108 }
109
110 return cfg
111}

Callers 1

initFunction · 0.92

Calls 2

DefaultConfigFunction · 0.85
getConfigFilePathFunction · 0.85

Tested by

no test coverage detected