Discover Packages
github.com/jiandahao/goutils
gsync
package
Version:
v0.1.1
Opens a new window with list of versions in this module.
Published: Jun 24, 2021
License: Apache-2.0
Opens a new window with license information.
Imports: 2
Opens a new window with list of imports.
Imported by: 0
Opens a new window with list of known importers.
Documentation
Documentation
¶
Map is sync.Map with counter. It is safe for concurrent use
by multiple goroutines without additional locking or coordination.
Loads, stores, and deletes run in amortized constant time.
func (m *Map ) Delete(key interface{})
Delete deletes the value for a key.
func (m *Map ) Exists(key interface{}) bool
Exists returns true if value is existed in the map
Length returns the length of the map
func (m *Map ) Store(key interface{}, value interface{})
Store sets the value for a key.
Slice is safe for concurrent use by multiple goroutines
without additional locking or coordination.
func (s *Slice ) Append(value interface{})
Append append element into slice
Delete deletes element in the slice at specified index
Length returns the length of the slice
func (s *Slice ) Range(f func(index int , value interface{}) bool )
Range calls f sequentially for each value present in the slice.
If f returns false, range stops the iteration.
Source Files
¶
Directories
¶
Click to show internal directories.
Click to hide internal directories.