diff --git a/g/container/gset/gset.go b/g/container/gset/gset.go index 7f01bc45d..8c02bd33b 100644 --- a/g/container/gset/gset.go +++ b/g/container/gset/gset.go @@ -125,19 +125,17 @@ func (set *Set) String() string { } // LockFunc locks writing with callback function . -func (set *Set) LockFunc(f func(m map[interface{}]struct{})) *Set { +func (set *Set) LockFunc(f func(m map[interface{}]struct{})) { set.mu.Lock() defer set.mu.Unlock() f(set.m) - return set } // RLockFunc locks reading with callback function . -func (set *Set) RLockFunc(f func(m map[interface{}]struct{})) *Set { +func (set *Set) RLockFunc(f func(m map[interface{}]struct{})) { set.mu.RLock() defer set.mu.RUnlock() f(set.m) - return set } // Equal checks whether the two sets equal. diff --git a/g/container/gset/gset_int_set.go b/g/container/gset/gset_int_set.go index 6e018d5fa..338952ff8 100644 --- a/g/container/gset/gset_int_set.go +++ b/g/container/gset/gset_int_set.go @@ -119,19 +119,17 @@ func (set *IntSet) String() string { } // LockFunc locks writing with callback function . -func (set *IntSet) LockFunc(f func(m map[int]struct{})) *IntSet { +func (set *IntSet) LockFunc(f func(m map[int]struct{})) { set.mu.Lock() defer set.mu.Unlock() f(set.m) - return set } // RLockFunc locks reading with callback function . -func (set *IntSet) RLockFunc(f func(m map[int]struct{})) *IntSet { +func (set *IntSet) RLockFunc(f func(m map[int]struct{})) { set.mu.RLock() defer set.mu.RUnlock() f(set.m) - return set } // Equal checks whether the two sets equal. diff --git a/g/container/gset/gset_string_set.go b/g/container/gset/gset_string_set.go index 4664e5808..7a5d20da4 100644 --- a/g/container/gset/gset_string_set.go +++ b/g/container/gset/gset_string_set.go @@ -120,19 +120,17 @@ func (set *StringSet) String() string { } // LockFunc locks writing with callback function . -func (set *StringSet) LockFunc(f func(m map[string]struct{})) *StringSet { +func (set *StringSet) LockFunc(f func(m map[string]struct{})) { set.mu.Lock() defer set.mu.Unlock() f(set.m) - return set } // RLockFunc locks reading with callback function . -func (set *StringSet) RLockFunc(f func(m map[string]struct{})) *StringSet { +func (set *StringSet) RLockFunc(f func(m map[string]struct{})) { set.mu.RLock() defer set.mu.RUnlock() f(set.m) - return set } // Equal checks whether the two sets equal.