mustmap

package
v0.0.9 Latest Latest
Warning

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

Go to latest
Published: Nov 28, 2024 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Equals

func Equals[K, V comparable](a, b map[K]V)

Equals compares two maps for equality. If they are not equal, it panics. Equals 比较两个 map 是否相等,如果不相等,则触发 panic。

func Get

func Get[K, V comparable](a map[K]V, key K) V

Get func get value of key from the map. If the key does not exist, it panics. Get 根据给定的键从 map 中检索值,如果键不存在,则触发 panic。

func Have

func Have[K comparable, V any](a map[K]V)

Have checks if a map is non-empty. If it is empty, it panics. Have 检查一个 map 是否非空,如果为空,则触发 panic。

func Len

func Len[K comparable, V any](a map[K]V, n int)

Len checks if the length of a map is equal to n. If not, it panics. Len 是 Length 的简写版本,检查一个 map 的长度是否等于 n,如果不等,则触发 panic。

func Length

func Length[K comparable, V any](a map[K]V, n int)

Length checks if the length of a map is equal to n. If not, it panics. Length 检查一个 map 的长度是否等于 n,如果不等,则触发 panic。

func Nice

func Nice[K comparable, V any](a map[K]V) map[K]V

Nice checks if a map is non-empty and returns it. If it is empty, it panics. Nice 检查一个 map 是否非空并返回它,如果为空,则触发 panic。

Types

This section is empty.

Jump to

Keyboard shortcuts

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