Discover Packages
github.com/tochemey/goakt/v2
internal
slices
package
Version:
v2.4.0
Opens a new window with list of versions in this module.
Published: Jul 26, 2024
License: MIT
Opens a new window with license information.
Imports: 1
Opens a new window with list of imports.
Imported by: 0
Opens a new window with list of known importers.
Documentation
Documentation
¶
func Chunk[T any ](slice []T, chunkSize int ) [][]T
Chunk helps chunk a slice into equal size
type Item[T any ] struct {
Index int
Value T
}
Item represents the slice item
Safe type that can be safely shared between goroutines.
NewSafe creates a new synchronized 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
Get returns the slice item at the given index
func (cs *Safe [T]) Iter() <-chan Item [T]
Iter iterates the items in the concurrent slice.
Each item is sent over a channel, so that
we can iterate over the slice using the builtin range keyword.
Len returns the number of items
Source Files
¶
Click to show internal directories.
Click to hide internal directories.