MCPcopy
hub / github.com/six2dez/OneListForAll / Load

Function Load

internal/config/config.go:90–106  ·  view source on GitHub ↗
(path string)

Source from the content-addressed store, hash-verified

88}
89
90func Load(path string) (Config, error) {
91 buf, err := os.ReadFile(path)
92 if err != nil {
93 return Config{}, fmt.Errorf("read config: %w", err)
94 }
95
96 var cfg Config
97 if err := json.Unmarshal(buf, &cfg); err != nil {
98 return Config{}, fmt.Errorf("parse config (JSON-in-YAML format): %w", err)
99 }
100
101 if err := cfg.Validate(); err != nil {
102 return Config{}, err
103 }
104
105 return cfg, nil
106}
107
108func (c Config) Validate() error {
109 if c.Version == "" {

Callers 7

RunFunction · 0.92
RunFunction · 0.92
RunFunction · 0.92
runStatsFunction · 0.92
runListFunction · 0.92
runPackageFunction · 0.92
runPipelineFunction · 0.92

Calls 1

ValidateMethod · 0.95

Tested by

no test coverage detected