map_utils

package
v0.2.4 Latest Latest
Warning

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

Go to latest
Published: Mar 5, 2023 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ShallowCloneOrderedMap

func ShallowCloneOrderedMap(m *orderedmap.OrderedMap) *orderedmap.OrderedMap

func ShallowUnmarshalMap

func ShallowUnmarshalMap(m map[string]interface{}, v any) error

func ShallowUnmarshalOrderedMap

func ShallowUnmarshalOrderedMap(m *orderedmap.OrderedMap, v any) error

func ToKeySortedMap

func ToKeySortedMap[T any](src map[string]T) *orderedmap.OrderedMap

func ToOrderedMap

func ToOrderedMap[T any](src map[string]T, sortFunc func([]string)) *orderedmap.OrderedMap

func UnorderMap

func UnorderMap(m *orderedmap.OrderedMap) map[string]interface{}

func UnorderMapTypedValues

func UnorderMapTypedValues[T any](m *orderedmap.OrderedMap) map[string]T

func UnsafeGet

func UnsafeGet[T any](m *orderedmap.OrderedMap, key string) T

UnsafeGet returns the value associated with the key without checking if the key exists. This is useful for loop iterations: The loop runs over the keys using Keys(), so it is safe to use Get(), Yet the original interface (with comma-ok) does not allow for inline-conversion, which forces the creation of an intermediate temporary variable.

func UnsafeGetUntyped

func UnsafeGetUntyped(m *orderedmap.OrderedMap, key string) interface{}

Types

This section is empty.

Jump to

Keyboard shortcuts

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