maputil

package
v1.45.0 Latest Latest
Warning

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

Go to latest
Published: May 30, 2025 License: Apache-2.0 Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Clone

func Clone[M ~map[K]V, K comparable, V any](src M) map[K]V

Clone creates and returns a shallow copy of the given map, preserving the original map's key-value pairs.

func Copy

func Copy[M ~map[K]V, K comparable, V any](src M) map[K]V

Copy creates and returns a new map by copying all the key-value pairs from the source map.

func HashMapToMap

func HashMapToMap[M ~map[K]V, K hashable, V any](src *hashmap.Map[K, V]) map[K]V

HashMapToMap converts a hashmap.Map to a native Go map with the same key-value pairs. Accepts a pointer to hashmap.Map and returns a map of the specified type. Ensures type compatibility using type parameters and constraints for key and value types. Utilizes Range to iterate over the hashmap and populate the native map.

func MapToHashMap

func MapToHashMap[M ~map[K]V, K hashable, V any](src M) *hashmap.Map[K, V]

MapToHashMap converts a generic map of type M into a hashmap.Map and returns a pointer to the resulting hashmap.

Types

This section is empty.

Directories

Path Synopsis
Package bimap from: https://github.com/vishalkuo/bimap
Package bimap from: https://github.com/vishalkuo/bimap

Jump to

Keyboard shortcuts

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