collections

package
v0.1.6 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ContainInt64

func ContainInt64(ids []int64, id int64) bool

func ContainKey

func ContainKey(dataMap map[string]interface{}, key string) bool

Types

type Set added in v0.1.1

type Set[T comparable] map[T]struct{}

Set 泛型Set实现

func NewSet added in v0.1.1

func NewSet[T comparable]() Set[T]

NewSet 创建新Set

func (Set[T]) Add added in v0.1.1

func (s Set[T]) Add(value T)

Add 添加元素

func (Set[T]) Contains added in v0.1.1

func (s Set[T]) Contains(value T) bool

Contains 检查元素是否存在

func (Set[T]) Remove added in v0.1.1

func (s Set[T]) Remove(value T)

Remove 删除元素

func (Set[T]) Size added in v0.1.1

func (s Set[T]) Size() int

Size 获取Set大小

func (Set[T]) ToSlice added in v0.1.1

func (s Set[T]) ToSlice() []T

ToSlice 转换为切片

Jump to

Keyboard shortcuts

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