MCPcopy Create free account
hub / github.com/Chat2AnyLLM/code-agent-manager / loadYAML

Function loadYAML

internal/editorconfig/yaml_tool.go:64–80  ·  view source on GitHub ↗
(path string)

Source from the content-addressed store, hash-verified

62}
63
64func loadYAML(path string) (map[string]any, string, error) {
65 data, err := os.ReadFile(path)
66 if err != nil {
67 if os.IsNotExist(err) {
68 return map[string]any{}, path, nil
69 }
70 return nil, path, fmt.Errorf("editorconfig: read %s: %w", path, err)
71 }
72 if len(data) == 0 {
73 return map[string]any{}, path, nil
74 }
75 out := map[string]any{}
76 if err := yaml.Unmarshal(data, &out); err != nil {
77 return nil, path, fmt.Errorf("editorconfig: parse %s: %w", path, err)
78 }
79 return out, path, nil
80}
81
82func (c *yamlToolConfig) LoadAll() map[string]ScopedConfig {
83 all := map[string]ScopedConfig{}

Callers 4

LoadMethod · 0.85
LoadAllMethod · 0.85
SetMethod · 0.85
UnsetMethod · 0.85

Calls 1

ReadFileMethod · 0.80

Tested by

no test coverage detected