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

Function writeYAML

internal/editorconfig/yaml_tool.go:141–153  ·  view source on GitHub ↗
(path string, data map[string]any)

Source from the content-addressed store, hash-verified

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

Callers 2

SetMethod · 0.85
UnsetMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected