https://github.com/neurocode-io/go-pkgs
Opinionated util functions working with go
https://github.com/neurocode-io/go-pkgs
generic go utility utility-library
Last synced: 8 months ago
JSON representation
Opinionated util functions working with go
- Host: GitHub
- URL: https://github.com/neurocode-io/go-pkgs
- Owner: neurocode-io
- License: mit
- Created: 2023-02-16T11:39:48.000Z (over 3 years ago)
- Default Branch: main
- Last Pushed: 2024-08-17T07:21:56.000Z (almost 2 years ago)
- Last Synced: 2025-02-16T23:26:54.457Z (over 1 year ago)
- Topics: generic, go, utility, utility-library
- Language: Go
- Homepage:
- Size: 36.1 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: Readme.md
- License: LICENSE
Awesome Lists containing this project
README
# go-pkgs [](https://github.com/neurocode-io/go-pkgs/actions/workflows/main.yaml) 
Collection of Go packages that I use in my projects. Implemented with go generics. Thus they are compatible with Go 1.18+.
## Installation
```bash
go get github.com/neurocode-io/go-pkgs@latest
```
## Packages
### slice
Slice is a package that provides a set of functions to work with slices.
### map
Map is a package that provides a set of functions to work with maps.
### set
Set is a package that provides a generic set implementation.
### async
```
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())
}
```
### streams
Coming soon