slice

package
v0.0.0-...-457d9f6 Latest Latest
Warning

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

Go to latest
Published: Oct 23, 2020 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Add

func Add(s []int, v int) []int

Add 添加元素到切片并返回新的切片

func CreateAnyTypeSlice

func CreateAnyTypeSlice(slice interface{}) ([]interface{}, bool)

CreateAnyTypeSlice 创建可接收任意类型的切片

func DeleteSliceE

func DeleteSliceE(slice interface{}, index int) (interface{}, error)

DeleteSliceE deletes the specified subscript element from the slice Note that original slice will not be modified

func GetEleIndexesSliceE

func GetEleIndexesSliceE(slice interface{}, value interface{}) ([]int, error)

GetEleIndexesSliceE finds all indexes of the specified element in a slice

func InsertSliceE

func InsertSliceE(slice interface{}, index int, value interface{}) (interface{}, error)

InsertSliceE insert a element to slice in the specified index Note that original slice will not be modified

func IsSlice

func IsSlice(arg interface{}) (val reflect.Value, ok bool)

IsSlice 判断是否切片

func RemoveAt

func RemoveAt(s []int, index int) []int

RemoveAt 删除指定位置的元素,返回新切片

func Sum

func Sum(s ...int) int

Sum 不定参数演示

func UpdateSliceE

func UpdateSliceE(slice interface{}, index int, value interface{}) (interface{}, error)

UpdateSliceE modifies the specified index element of slice Note that original slice will not be modified

Types

This section is empty.

Jump to

Keyboard shortcuts

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