go-utils
Go library that provides utilities functions to manipulate slices type, json serialization, io, and http calls.
Usage
The main goal is to make code cooler to write in implementations, have fun coding and discover a new language!
Run $ go get github.com/joakim-ribier/go-utils
to add this library on your project.
Otherwise, you can download it and start $ go build ./...
to work on.
slicesutil
// []User --> []User
slicesutil.FilterT[User](users, func(u User) bool {
return u.Age > 17
})
// []User --> *User
slicesutil.FindT[User](users, func(u User) bool {
return u.Age == 2
})
// []User --> []string
slicesutil.TransformT[User, string](users, func(u User) (*string, error) {
return &u.Name, nil
})
Find more examples on the README.md (pkg/slicesutil).
Projects using go-utils
License
This software is licensed under the MIT license, see License for more information.