Categorygithub.com/earlgray283/goder
repositorypackage
0.0.0-20230304050816-cd1be7c9d622
Repository: https://github.com/earlgray283/goder.git
Documentation: pkg.go.dev

# README

Goder

Description

Goder enables gophers to compate using generics and external packages.

Installation

$ go install github.com/earlgray283/goder@latest

Usage

$ goder examples/samber_lo.go
package main

import (
	"fmt"
	"strconv"
)

func main() {
	a := []int{1, 2, 3, 4, 5}
	b := MapXvlbzgba(a, func(t int, _ int) string {
		return strconv.Itoa(t)
	})
	fmt.Println(a, b)
}
func MapXvlbzgba(collection []int, iteratee func(int, int) string) []string {
	result := make([]string, len(collection))
	for i, item := range collection {
		result[i] = iteratee(item, i)
	}
	return result
}