go-utils

module
v0.0.0-...-9e322e5 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 15, 2024 License: MIT

README

go-utils

Go Report Card Software License Go Reference codecov

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.

Directories

Path Synopsis
cmd
pkg

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL