Edit: Works now. Also updated module name
This commit is contained in:
parent
e2e40cb56e
commit
4a35be2949
2 changed files with 3 additions and 1 deletions
2
go.mod
2
go.mod
|
@ -1,3 +1,3 @@
|
||||||
module gitlab.com/beckersamuel9/utils
|
module gitlab.com/beckersamuel9/goutils
|
||||||
|
|
||||||
go 1.19
|
go 1.19
|
||||||
|
|
|
@ -1,5 +1,7 @@
|
||||||
package maps
|
package maps
|
||||||
|
|
||||||
|
import "gitlab.com/beckersamuel9/goutils/pkg/sliceutils"
|
||||||
|
|
||||||
// MapMap applies a given function to every key-value pair of a map.
|
// MapMap applies a given function to every key-value pair of a map.
|
||||||
// The returned map's value type may be different from the type of the inital map's value.
|
// The returned map's value type may be different from the type of the inital map's value.
|
||||||
func MapMap[K comparable, V any, R any](dic map[K]V, apply func(K, V) R) map[K]R {
|
func MapMap[K comparable, V any, R any](dic map[K]V, apply func(K, V) R) map[K]R {
|
||||||
|
|
Loading…
Reference in a new issue