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

9ca2bf9 Β· May 25, 2022

History

8 Commits
May 25, 2022
May 25, 2022
May 25, 2022
May 25, 2022
May 25, 2022
May 25, 2022
May 25, 2022
May 25, 2022
May 25, 2022
May 25, 2022

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