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

Method Set

internal/editorconfig/yaml_tool.go:98–116  ·  view source on GitHub ↗
(scope Scope, keyPath string, value any)

Source from the content-addressed store, hash-verified

96}
97
98func (c *yamlToolConfig) Set(scope Scope, keyPath string, value any) (string, error) {
99 parts, err := Parse(keyPath)
100 if err != nil {
101 return "", err
102 }
103 path := c.PathFor(scope)
104 if path == "" {
105 return "", fmt.Errorf("editorconfig: %s scope %s unsupported", c.spec.name, scope)
106 }
107 data, _, err := loadYAML(path)
108 if err != nil {
109 return "", err
110 }
111 Set(data, parts, value)
112 if err := writeYAML(path, data); err != nil {
113 return "", err
114 }
115 return path, nil
116}
117
118func (c *yamlToolConfig) Unset(scope Scope, keyPath string) (bool, string, error) {
119 parts, err := Parse(keyPath)

Callers

nothing calls this directly

Calls 5

PathForMethod · 0.95
ParseFunction · 0.85
loadYAMLFunction · 0.85
SetFunction · 0.85
writeYAMLFunction · 0.85

Tested by

no test coverage detected