Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Map ¶
Map creates a new slice with the same number elements as the input s with the values generated by mapFunc
func ToMap ¶
func ToMap[K comparable, V any, S ~[]E, E any](s S, key func(int) K, val func(int) V) map[K]V
ToMap creates a map[K]V out of the provided slice s using key() to create the map keys and val() to create the values.
The caller can compare the length of the map to the one of the slice in order to detect potential key conflicts.
func ToRefMap ¶
func ToRefMap[K comparable, S ~[]E, E any](s S, key func(*E) K) map[K]*E
ToRefMap creates a map[K]*S out of the provided slice s []S using key() to create the map keys.
The caller can compare the length of the map to the one of the slice in order to detect potential key conflicts.
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.