Slice

package
v1.0.2 Latest Latest
Warning

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

Go to latest
Published: Jan 15, 2026 License: GPL-3.0 Imports: 2 Imported by: 4

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Append

func Append[T any](list []T, tail []T) []T

func Find

func Find(list interface{}, value interface{}) int

Find 找到某个元素的下标

func Has

func Has(list interface{}, value interface{}) bool

func Interfaces

func Interfaces(list interface{}) []interface{}

Interfaces 复制一个副本

func Remove

func Remove(slicePtr interface{}, index int)

Remove 删除某个元素

func Reverse

func Reverse(array interface{})

Reverse 将数组反转

func Split

func Split[T any](dataList []T, pageSize int) [][]T

func ToInt64List

func ToInt64List(list []interface{}) []int64

ToInt64List 转换为MapList格式

func ToList added in v1.0.2

func ToList[V any](list []interface{}, defaultValue V) []V

ToList 将[]interface{}强制转换为具体的类型,valueType是给出类型的样例

func ToMapList

func ToMapList(list []interface{}) []map[string]interface{}

ToMapList 转换为MapList格式

Types

This section is empty.

Jump to

Keyboard shortcuts

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