mirror of
https://github.com/astaxie/beego.git
synced 2025-07-10 03:10:18 +00:00
golint utils
This commit is contained in:
@ -18,6 +18,7 @@ import (
|
||||
"sync"
|
||||
)
|
||||
|
||||
// BeeMap is a map with lock
|
||||
type BeeMap struct {
|
||||
lock *sync.RWMutex
|
||||
bm map[interface{}]interface{}
|
||||
@ -41,7 +42,7 @@ func (m *BeeMap) Get(k interface{}) interface{} {
|
||||
return nil
|
||||
}
|
||||
|
||||
// Maps the given key and value. Returns false
|
||||
// Set Maps the given key and value. Returns false
|
||||
// if the key is already in the map and changes nothing.
|
||||
func (m *BeeMap) Set(k interface{}, v interface{}) bool {
|
||||
m.lock.Lock()
|
||||
@ -56,7 +57,7 @@ func (m *BeeMap) Set(k interface{}, v interface{}) bool {
|
||||
return true
|
||||
}
|
||||
|
||||
// Returns true if k is exist in the map.
|
||||
// Check Returns true if k is exist in the map.
|
||||
func (m *BeeMap) Check(k interface{}) bool {
|
||||
m.lock.RLock()
|
||||
defer m.lock.RUnlock()
|
||||
|
Reference in New Issue
Block a user