[skip ci]Fix golint error in mem_kv (#10862)

Signed-off-by: zhenshan.cao <zhenshan.cao@zilliz.com>
pull/10865/head
zhenshan.cao 2021-10-28 23:54:55 +08:00 committed by GitHub
parent 203da4be2b
commit 5320698e29
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 4 additions and 0 deletions

View File

@ -41,6 +41,7 @@ func (s memoryKVItem) Less(than btree.Item) bool {
return s.key < than.(memoryKVItem).key
}
// Load loads an object with @key.
func (kv *MemoryKV) Load(key string) (string, error) {
kv.RLock()
defer kv.RUnlock()
@ -79,6 +80,7 @@ func (kv *MemoryKV) LoadRange(key, endKey string, limit int) ([]string, []string
return keys, values, nil
}
// Save object with @key to Minio. Object value is @value.
func (kv *MemoryKV) Save(key, value string) error {
kv.Lock()
defer kv.Unlock()
@ -86,6 +88,7 @@ func (kv *MemoryKV) Save(key, value string) error {
return nil
}
// Remove delete an object with @key.
func (kv *MemoryKV) Remove(key string) error {
kv.Lock()
defer kv.Unlock()
@ -94,6 +97,7 @@ func (kv *MemoryKV) Remove(key string) error {
return nil
}
// MultiLoad loads objects with multi @keys.
func (kv *MemoryKV) MultiLoad(keys []string) ([]string, error) {
kv.RLock()
defer kv.RUnlock()