Skip to content
This repository has been archived by the owner on Feb 4, 2023. It is now read-only.

Latest commit

 

History

History
17 lines (12 loc) · 421 Bytes

README.md

File metadata and controls

17 lines (12 loc) · 421 Bytes

syncslice

Goroutine-safe wrapper interface over a generic slice using sync.RWMutex.

You don't need this library. Slices are already safe. See #1 and https://go.dev/blog/slices-intro.

s := syncslice.Make[string](2, 3)

s.Set(0, "hello")
s.Set(1, "world")
s.Append("!")

for item := range s.Iter() {
    fmt.Println(item.Value)
}