maps

package
v0.50.5 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 25, 2023 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Join

func Join[M ~map[K]V, K comparable, V any](m M, sliceSep, mapSep string) string

Join converts the map to a string type by concatenating the key with the value using the given `mapSep` string, and `sliceSep` string between the slice values. For example: `Slice(map[int]string{1: "one", 2: "two"}, "-", ", ")` returns `"1-one, 2-two"`

func Slice

func Slice[M ~map[K]V, K comparable, V any](m M, sep string) []string

Slice converts the map to a string slice by concatenating the key with the value using the given `sep` string. For example: `Slice(map[int]string{1: "one", 2: "two"}, "-")` returns `[]string{"1-one", "2-two"}`

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL