mirror of https://github.com/milvus-io/milvus.git
[skip ci]Fix golint error in mem_kv (#10862)
Signed-off-by: zhenshan.cao <zhenshan.cao@zilliz.com>pull/10865/head
parent
203da4be2b
commit
5320698e29
|
@ -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()
|
||||
|
|
Loading…
Reference in New Issue