Skip to content

Instantly share code, notes, and snippets.

@mottet-dev

mottet-dev/main.go

Created Jun 20, 2019
Embed
What would you like to do?
Go Funk - Map
package main
import (
"fmt"
"github.com/thoas/go-funk"
)
func main() {
baseSlice := []int{1, 2, 3, 4, 5}
newSlice := funk.Map(baseSlice, func(x int) int {
return x + 1
})
fmt.Println(baseSlice)
fmt.Println(newSlice)
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.