nocasemaps

package
v1.54.1 Latest Latest
Warning

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

Go to latest
Published: Nov 30, 2023 License: BSD-3-Clause Imports: 2 Imported by: 1

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 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