修正gmap部分类型全局替换造成的错误

This commit is contained in:
John
2018-01-17 15:32:04 +08:00
parent 337a01d63d
commit ac5bbaa76e
5 changed files with 27 additions and 26 deletions

View File

@ -59,27 +59,27 @@ func (this *IntInterfaceMap) Get(key int) (interface{}) {
}
func (this *IntInterfaceMap) GetBool(key int) bool {
return gconv.Bool(this.mu.Get(key))
return gconv.Bool(this.Get(key))
}
func (this *IntInterfaceMap) GetInt(key int) int {
return gconv.Int(this.mu.Get(key))
return gconv.Int(this.Get(key))
}
func (this *IntInterfaceMap) GetUint (key int) uint {
return gconv.Uint(this.mu.Get(key))
return gconv.Uint(this.Get(key))
}
func (this *IntInterfaceMap) GetFloat32 (key int) float32 {
return gconv.Float32(this.mu.Get(key))
return gconv.Float32(this.Get(key))
}
func (this *IntInterfaceMap) GetFloat64 (key int) float64 {
return gconv.Float64(this.mu.Get(key))
return gconv.Float64(this.Get(key))
}
func (this *IntInterfaceMap) GetString (key int) string {
return gconv.String(this.mu.Get(key))
return gconv.String(this.Get(key))
}
// 删除键值对

View File

@ -59,27 +59,27 @@ func (this *InterfaceInterfaceMap) Get(key interface{}) (interface{}) {
}
func (this *InterfaceInterfaceMap) GetBool(key interface{}) bool {
return gconv.Bool(this.mu.Get(key))
return gconv.Bool(this.Get(key))
}
func (this *InterfaceInterfaceMap) GetInt(key interface{}) int {
return gconv.Int(this.mu.Get(key))
return gconv.Int(this.Get(key))
}
func (this *InterfaceInterfaceMap) GetUint (key interface{}) uint {
return gconv.Uint(this.mu.Get(key))
return gconv.Uint(this.Get(key))
}
func (this *InterfaceInterfaceMap) GetFloat32 (key interface{}) float32 {
return gconv.Float32(this.mu.Get(key))
return gconv.Float32(this.Get(key))
}
func (this *InterfaceInterfaceMap) GetFloat64 (key interface{}) float64 {
return gconv.Float64(this.mu.Get(key))
return gconv.Float64(this.Get(key))
}
func (this *InterfaceInterfaceMap) GetString (key interface{}) string {
return gconv.String(this.mu.Get(key))
return gconv.String(this.Get(key))
}
// 删除键值对

View File

@ -59,27 +59,27 @@ func (this *StringInterfaceMap) Get(key string) interface{} {
}
func (this *StringInterfaceMap) GetBool(key string) bool {
return gconv.Bool(this.mu.Get(key))
return gconv.Bool(this.Get(key))
}
func (this *StringInterfaceMap) GetInt(key string) int {
return gconv.Int(this.mu.Get(key))
return gconv.Int(this.Get(key))
}
func (this *StringInterfaceMap) GetUint (key string) uint {
return gconv.Uint(this.mu.Get(key))
return gconv.Uint(this.Get(key))
}
func (this *StringInterfaceMap) GetFloat32 (key string) float32 {
return gconv.Float32(this.mu.Get(key))
return gconv.Float32(this.Get(key))
}
func (this *StringInterfaceMap) GetFloat64 (key string) float64 {
return gconv.Float64(this.mu.Get(key))
return gconv.Float64(this.Get(key))
}
func (this *StringInterfaceMap) GetString (key string) string {
return gconv.String(this.mu.Get(key))
return gconv.String(this.Get(key))
}
// 删除键值对

View File

@ -59,27 +59,27 @@ func (this *UintInterfaceMap) Get(key uint) (interface{}) {
}
func (this *UintInterfaceMap) GetBool(key uint) bool {
return gconv.Bool(this.mu.Get(key))
return gconv.Bool(this.Get(key))
}
func (this *UintInterfaceMap) GetInt(key uint) int {
return gconv.Int(this.mu.Get(key))
return gconv.Int(this.Get(key))
}
func (this *UintInterfaceMap) GetUint (key uint) uint {
return gconv.Uint(this.mu.Get(key))
return gconv.Uint(this.Get(key))
}
func (this *UintInterfaceMap) GetFloat32 (key uint) float32 {
return gconv.Float32(this.mu.Get(key))
return gconv.Float32(this.Get(key))
}
func (this *UintInterfaceMap) GetFloat64 (key uint) float64 {
return gconv.Float64(this.mu.Get(key))
return gconv.Float64(this.Get(key))
}
func (this *UintInterfaceMap) GetString (key uint) string {
return gconv.String(this.mu.Get(key))
return gconv.String(this.Get(key))
}
// 删除键值对
@ -142,9 +142,9 @@ func (this *UintInterfaceMap) Contains(key uint) bool {
// 哈希表大小
func (this *UintInterfaceMap) Size() int {
this.mu.RLock()
len := len(this.m)
length := len(this.m)
this.mu.RUnlock()
return len
return length
}
// 哈希表是否为空

View File

@ -0,0 +1 @@
package gbinary