collections

package
v0.4.1 Latest Latest
Warning

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

Go to latest
Published: Dec 14, 2023 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type OrderedKeysMap

type OrderedKeysMap[K cmp.Ordered, V any] map[K]V

OrderedKeysMap provides a deterministic way to iterate the contents of a map. The problem with a regular iteration is that the order the elements are presented is not guaranteed. This can be detrimental when consistency is paramount. Any map that needs to be iterated deterministically, should use the Keys() function for the iteration loop and obtain the value using this key to index into the map.

func (*OrderedKeysMap[K, V]) Keys

func (m *OrderedKeysMap[K, V]) Keys() []K

Jump to

Keyboard shortcuts

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