package
Version:
v0.0.0-...-113f59a
Opens a new window with list of versions in this module.
Published: Feb 16, 2024
License: BSD-3-Clause
Opens a new window with license information.
Imports: 2
Opens a new window with list of imports.
Imported by: 0
Opens a new window with list of known importers.
Documentation
¶
nocasemaps provides efficient functions to set and get entries in Go maps
keyed by a string, where the string is always lower-case.
-
func AppendSliceElem[K ~string, S []E, E any](m map[K]S, k K, vs ...E)
-
func Delete[K ~string, V any](m map[K]V, k K)
-
func Get[K ~string, V any](m map[K]V, k K) V
-
func GetOk[K ~string, V any](m map[K]V, k K) (V, bool)
-
func Set[K ~string, V any](m map[K]V, k K, v V)
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[K ~string, V any](m map[K]V, k K)
Delete is equivalent to:
delete(m, strings.ToLower(k))
Get is equivalent to:
v := m[strings.ToLower(k)]
GetOk is equivalent to:
v, ok := m[strings.ToLower(k)]
func Set[K ~string, V any](m map[K]V, k K, v V)
Set is equivalent to:
m[strings.ToLower(k)] = v
Source Files
¶
Click to show internal directories.
Click to hide internal directories.