Skip to content
/ lox Public

Extends github.com/samber/lo with error handling and other useful utilities

License

Notifications You must be signed in to change notification settings

otterize/lox

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

lox 🥯

Extends samber/lo with error handling and other useful utilities.

🚀 Install

go get github.com/otterize/lox

💡 Usage

package main

import (
	"fmt"
	"github.com/otterize/lox"
	"strings"
)

func main() {
	names, err := lox.MapErr([]string{"Otter", "Other", "Utter"}, func(s string, i int) (string, error) {
		if s == "" {
			return "", fmt.Errorf("empty name")
		}
		return s, nil
	})

	if err != nil {
		panic(err)
	}

	fmt.Printf("Names: %s", strings.Join(names, ","))
}

👤 Authors

About

Extends github.com/samber/lo with error handling and other useful utilities

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages