MCPcopy Create free account
hub / github.com/alibaba/open-code-review / LoadAppConfig

Function LoadAppConfig

cmd/opencodereview/config_cmd.go:594–607  ·  view source on GitHub ↗

LoadAppConfig loads config from path. Returns nil, nil if file does not exist.

(path string)

Source from the content-addressed store, hash-verified

592
593// LoadAppConfig loads config from path. Returns nil, nil if file does not exist.
594func LoadAppConfig(path string) (*Config, error) {
595 data, err := os.ReadFile(path)
596 if err != nil {
597 if os.IsNotExist(err) {
598 return nil, nil
599 }
600 return nil, fmt.Errorf("read app config %s: %w", path, err)
601 }
602 var cfg Config
603 if err := json.Unmarshal(data, &cfg); err != nil {
604 return nil, fmt.Errorf("parse app config: %w", err)
605 }
606 return &cfg, nil
607}
608
609// supportedConfigKeys is the single source of truth for the top-level config
610// keys accepted by setConfigValue. The unknown-key error message is generated

Callers 7

previewMaxTokensFunction · 0.85
loadLLMRuntimeFunction · 0.85
runLLMTestWithConfigPathFunction · 0.85

Calls

no outgoing calls