refactor(api)!: remove Delete method from public API

Environment variables are unaffected by Delete, making it misleading —
callers would expect a key to be fully gone but env vars would still
resolve. Sub is the better abstraction for scoped config.
This commit is contained in:
2026-03-09 19:35:59 +00:00
parent ff8a3444f1
commit a81a2027ae
3 changed files with 0 additions and 92 deletions

View File

@@ -28,19 +28,6 @@ func (c *ConfigManager) Set(key string, value any) {
c.combinedConfig[lower] = ConfigMap{Key: key, Value: value}
}
// Delete removes a key from all configuration layers (overrides, file,
// defaults) and rebuilds the combined configuration. Environment variables
// are not affected since they are loaded from the process environment.
func (c *ConfigManager) Delete(key string) {
c.mutex.Lock()
lower := strings.ToLower(key)
delete(c.overrideConfig, lower)
delete(c.fileConfig, lower)
delete(c.defaultConfig, lower)
delete(c.combinedConfig, lower)
c.mutex.Unlock()
}
func (c *ConfigManager) SetDefault(key string, value any) {
c.mutex.Lock()
defer c.mutex.Unlock()