From 72d2bd6dc0706ada6ada19819de9e1c664780ef7 Mon Sep 17 00:00:00 2001 From: a Date: Fri, 2 Sep 2022 23:08:36 -0500 Subject: [PATCH] add new map nil --- map.go | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/map.go b/map.go index c72559b..332ef5c 100644 --- a/map.go +++ b/map.go @@ -1,5 +1,11 @@ package lambda +func MapNil[T any](xs []T, fx func(T)) { + for _, v := range xs { + fx(v) + } +} + func Map[T any](xs []T, fx func(T) T) []T { for i, v := range xs { xs[i] = fx(v)