gmap

package
v0.0.0-...-f62b1ef Latest Latest
Warning

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

Go to latest
Published: Aug 13, 2024 License: MIT Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Clone

func Clone[K comparable, V any](originalMap map[K]V) map[K]V

func Delete

func Delete[K comparable, V any](m *Map[K, V], key K)

func Load

func Load[K comparable, V any](m *Map[K, V], key K) (value V, ok bool)

func LoadAndDelete

func LoadAndDelete[K comparable, V any](m *Map[K, V], key K) (value V, loaded bool)

func LoadOrStore

func LoadOrStore[K comparable, V any](m *Map[K, V], key K, value V) (actual V, loaded bool)

func Range

func Range[K comparable, V any](m *Map[K, V], f func(key K, value V) bool)

func Size

func Size[K comparable, V any](m *Map[K, V]) int

func Store

func Store[K comparable, V any](m *Map[K, V], key K, value V)

func Swap

func Swap[K comparable, V any](m *Map[K, V], key K, value V) (previous V, loaded bool)

Types

type Map

type Map[K comparable, V any] struct {
	// contains filtered or unexported fields
}

func NewMap

func NewMap[K comparable, V any]() *Map[K, V]

Jump to

Keyboard shortcuts

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