Collection of Go packages that I use in my projects. Implemented with go generics. Thus they are compatible with Go 1.18+.
go get github.com/neurocode-io/go-pkgs@latest
Slice is a package that provides a set of functions to work with slices.
Map is a package that provides a set of functions to work with maps.
Set is a package that provides a generic set implementation.
group := result.Group[ResultType]{}
ctx := context.Background()
threshold := 1
group, ctx := resultgroup.WithErrorsThreshold[ResultType](ctx, threshold)
group.Go(func() ([]ResultType, error) {
return []ResultType{}, nil
})
results, err := group.Wait()
if err != nil {
fmt.Println("Error:", err)
fmt.Println("Wrapped errors", err.Unwrap())
}
Coming soon