diff --git a/g/container/garray/garray_int.go b/g/container/garray/garray_int.go index a08b3a404..ebaca9a5e 100644 --- a/g/container/garray/garray_int.go +++ b/g/container/garray/garray_int.go @@ -65,7 +65,7 @@ func (a *IntArray) Insert(index int, value int) { func (a *IntArray) Remove(index int) { a.mu.Lock() a.array = append(a.array[ : index], a.array[index + 1 : ]...) - a.mu.RUnlock() + a.mu.Unlock() } // 追加数据项 diff --git a/g/container/garray/garray_interface.go b/g/container/garray/garray_interface.go index 53ef5671c..5699740f0 100644 --- a/g/container/garray/garray_interface.go +++ b/g/container/garray/garray_interface.go @@ -55,7 +55,7 @@ func (a *Array) Insert(index int, value interface{}) { func (a *Array) Remove(index int) { a.mu.Lock() a.array = append(a.array[ : index], a.array[index + 1 : ]...) - a.mu.RUnlock() + a.mu.Unlock() } // 追加数据项 diff --git a/g/container/garray/garray_sorted_int.go b/g/container/garray/garray_sorted_int.go index 495a45708..1651b47cb 100644 --- a/g/container/garray/garray_sorted_int.go +++ b/g/container/garray/garray_sorted_int.go @@ -79,7 +79,7 @@ func (a *SortedIntArray) Get(index int) int { func (a *SortedIntArray) Remove(index int) { a.mu.Lock() a.array = append(a.array[ : index], a.array[index + 1 : ]...) - a.mu.RUnlock() + a.mu.Unlock() } // 数组长度 diff --git a/g/container/garray/garray_sorted_interface.go b/g/container/garray/garray_sorted_interface.go index 6c76eddd0..35eeaa259 100644 --- a/g/container/garray/garray_sorted_interface.go +++ b/g/container/garray/garray_sorted_interface.go @@ -64,7 +64,7 @@ func (a *SortedArray) Get(index int) interface{} { func (a *SortedArray) Remove(index int) { a.mu.Lock() a.array = append(a.array[ : index], a.array[index + 1 : ]...) - a.mu.RUnlock() + a.mu.Unlock() } // 数组长度 diff --git a/g/container/garray/garray_sorted_string.go b/g/container/garray/garray_sorted_string.go index b4dfff8da..a3fc76e47 100644 --- a/g/container/garray/garray_sorted_string.go +++ b/g/container/garray/garray_sorted_string.go @@ -74,7 +74,7 @@ func (a *SortedStringArray) Get(index int) string { func (a *SortedStringArray) Remove(index int) { a.mu.Lock() a.array = append(a.array[ : index], a.array[index + 1 : ]...) - a.mu.RUnlock() + a.mu.Unlock() } // 数组长度