package
Version:
v2.8.1
Opens a new window with list of versions in this module.
Published: Nov 21, 2024
License: MIT
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
¶
func Chunk[T any](slice []T, chunkSize int) [][]T
Chunk helps chunk a slice into equal size
type Safe[T any] struct {
}
Safe type that can be safely shared between goroutines.
NewSafe creates a new lock-free thread-safe slice.
func (cs *Safe[T]) Append(item T)
Append adds an item to the concurrent slice.
func (cs *Safe[T]) Delete(index int)
Delete an item from the slice
func (cs *Safe[T]) Get(index int) (item T)
Get returns the slice item at the given index
func (cs *Safe[T]) Items() []T
Items returns the list of items
Len returns the number of items
func (cs *Safe[T]) Reset()
Reset resets the slice
Source Files
¶
Click to show internal directories.
Click to hide internal directories.