1
0
mirror of https://github.com/astaxie/beego.git synced 2025-07-10 03:10:18 +00:00

golint utils

This commit is contained in:
astaxie
2015-09-14 23:35:13 +08:00
parent 5015614fdc
commit c6448727de
6 changed files with 14 additions and 12 deletions

View File

@ -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()