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

Function writeTOML

internal/editorconfig/toml_tool.go:138–150  ·  view source on GitHub ↗
(path string, data map[string]any)

Source from the content-addressed store, hash-verified

136}
137
138func writeTOML(path string, data map[string]any) error {
139 if err := os.MkdirAll(filepath.Dir(path), 0o755); err != nil {
140 return fmt.Errorf("editorconfig: mkdir %s: %w", filepath.Dir(path), err)
141 }
142 encoded, err := toml.Marshal(data)
143 if err != nil {
144 return fmt.Errorf("editorconfig: marshal %s: %w", path, err)
145 }
146 if err := os.WriteFile(path, encoded, 0o600); err != nil {
147 return fmt.Errorf("editorconfig: write %s: %w", path, err)
148 }
149 return nil
150}

Callers 2

SetMethod · 0.85
UnsetMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected