MCPcopy
hub / github.com/abiosoft/colima / LoadFrom

Function LoadFrom

config/configmanager/configmanager.go:35–48  ·  view source on GitHub ↗

LoadFrom loads config from file.

(file string)

Source from the content-addressed store, hash-verified

33
34// LoadFrom loads config from file.
35func LoadFrom(file string) (config.Config, error) {
36 var c config.Config
37 b, err := os.ReadFile(file)
38 if err != nil {
39 return c, fmt.Errorf("could not load config from file: %w", err)
40 }
41
42 err = yaml.Unmarshal(b, &c)
43 if err != nil {
44 return c, fmt.Errorf("could not load config from file: %w", err)
45 }
46
47 return c, nil
48}
49
50// ValidateConfig validates config before we use it
51func ValidateConfig(c config.Config) error {

Callers 8

ConfigMethod · 0.92
setFixedConfigsFunction · 0.92
prepareConfigFunction · 0.92
editConfigFileFunction · 0.92
template.goFile · 0.92
SaveFromFileFunction · 0.85
LoadFunction · 0.85
LoadInstanceFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected