safety

package
v1.1.42 Latest Latest
Warning

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

Go to latest
Published: Dec 8, 2024 License: MIT Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Map

type Map[K comparable, T any] struct {
	// contains filtered or unexported fields
}

Map 安全的map

func NewMap

func NewMap[K comparable, T any]() *Map[K, T]

NewMap 创建一个安全的map

func (*Map[K, T]) Clear

func (m *Map[K, T]) Clear()

Clear 清空map

func (*Map[K, T]) Delete

func (m *Map[K, T]) Delete(key K)

Delete 删除map中的值

func (*Map[K, T]) Get

func (m *Map[K, T]) Get(key K) (T, bool)

Get 获取map中的值

func (*Map[K, T]) List

func (m *Map[K, T]) List() map[K]T

List 获取map中的所有值

func (*Map[K, T]) Set

func (m *Map[K, T]) Set(key K, value T)

Set 设置map中的值

Jump to

Keyboard shortcuts

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