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

Function loadTOML

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

Source from the content-addressed store, hash-verified

62}
63
64func loadTOML(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 out := map[string]any{}
73 if err := toml.Unmarshal(data, &out); err != nil {
74 return nil, path, fmt.Errorf("editorconfig: parse %s: %w", path, err)
75 }
76 return out, path, nil
77}
78
79func (c *tomlToolConfig) LoadAll() map[string]ScopedConfig {
80 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