diff options
Diffstat (limited to 'repository/config_mem.go')
-rw-r--r-- | repository/config_mem.go | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/repository/config_mem.go b/repository/config_mem.go index 5ce577ac..9725e8d5 100644 --- a/repository/config_mem.go +++ b/repository/config_mem.go @@ -1,6 +1,7 @@ package repository import ( + "fmt" "strconv" "strings" "time" @@ -77,10 +78,17 @@ func (mc *MemConfig) ReadTimestamp(key string) (time.Time, error) { // RmConfigs remove all key/value pair matching the key prefix func (mc *MemConfig) RemoveAll(keyPrefix string) error { + found := false for key := range mc.config { if strings.HasPrefix(key, keyPrefix) { delete(mc.config, key) + found = true } } + + if !found { + return fmt.Errorf("section not found") + } + return nil } |