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

Method Unset

internal/editorconfig/toml_tool.go:115–136  ·  view source on GitHub ↗
(scope Scope, keyPath string)

Source from the content-addressed store, hash-verified

113}
114
115func (c *tomlToolConfig) Unset(scope Scope, keyPath string) (bool, string, error) {
116 parts, err := Parse(keyPath)
117 if err != nil {
118 return false, "", err
119 }
120 path := c.PathFor(scope)
121 if path == "" {
122 return false, "", fmt.Errorf("editorconfig: %s scope %s unsupported", c.spec.name, scope)
123 }
124 data, _, err := loadTOML(path)
125 if err != nil {
126 return false, "", err
127 }
128 found := Unset(data, parts)
129 if !found {
130 return false, path, nil
131 }
132 if err := writeTOML(path, data); err != nil {
133 return false, "", err
134 }
135 return true, path, nil
136}
137
138func writeTOML(path string, data map[string]any) error {
139 if err := os.MkdirAll(filepath.Dir(path), 0o755); err != nil {

Callers

nothing calls this directly

Calls 5

PathForMethod · 0.95
ParseFunction · 0.85
loadTOMLFunction · 0.85
UnsetFunction · 0.85
writeTOMLFunction · 0.85

Tested by

no test coverage detected