nocasemaps

package
v0.0.0-...-113f59a Latest Latest
Warning

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

Go to latest
Published: Feb 16, 2024 License: BSD-3-Clause Imports: 2 Imported by: 0

Documentation

Overview

nocasemaps provides efficient functions to set and get entries in Go maps keyed by a string, where the string is always lower-case.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AppendSliceElem

func AppendSliceElem[K ~string, S []E, E any](m map[K]S, k K, vs ...E)

AppendSliceElem is equivalent to:

append(m[strings.ToLower(k)], v)

func Delete

func Delete[K ~string, V any](m map[K]V, k K)

Delete is equivalent to:

delete(m, strings.ToLower(k))

func Get

func Get[K ~string, V any](m map[K]V, k K) V

Get is equivalent to:

v := m[strings.ToLower(k)]

func GetOk

func GetOk[K ~string, V any](m map[K]V, k K) (V, bool)

GetOk is equivalent to:

v, ok := m[strings.ToLower(k)]

func Set

func Set[K ~string, V any](m map[K]V, k K, v V)

Set is equivalent to:

m[strings.ToLower(k)] = v

Types

This section is empty.

Jump to

Keyboard shortcuts

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