slices

package
v0.0.0-...-ffbb05e Latest Latest
Warning

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

Go to latest
Published: Apr 15, 2025 License: MIT Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Chunk

func Chunk[T any, Slice ~[]T](collection Slice, size int) []Slice

Chunk 对切片进行分块,分块的长度为size

func Reverse

func Reverse[T any, Slice ~[]T](collection Slice)

Reverse 对切片进行逆序

func Set

func Set[T comparable, Slice ~[]T](collection Slice) map[T]struct{}

Set 使用切片元素构造集合

func Shuffle

func Shuffle[T any, Slice ~[]T](collection Slice) Slice

Shuffle 打乱切片元素顺序

func Uniq

func Uniq[T comparable, Slice ~[]T](collection Slice) Slice

Uniq 对切片元素进行去重

Types

This section is empty.

Jump to

Keyboard shortcuts

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