Documentation
¶
Overview ¶
Copyright 2020 slice Author(https://github.com/yudeguang17/slice). All Rights Reserved.
This Source Code Form is subject to the terms of the MIT License. If a copy of the MIT was not distributed with this file, You can obtain one at https://github.com/yudeguang17/slice.
Copyright 2020 slice Author(https://github.com/yudeguang17/slice). All Rights Reserved.
This Source Code Form is subject to the terms of the MIT License. If a copy of the MIT was not distributed with this file, You can obtain one at https://github.com/yudeguang17/slice.
Copyright 2020 slice Author(https://github.com/yudeguang17/slice). All Rights Reserved.
This Source Code Form is subject to the terms of the MIT License. If a copy of the MIT was not distributed with this file, You can obtain one at https://github.com/yudeguang17/slice.
Copyright 2020 slice Author(https://github.com/yudeguang17/slice). All Rights Reserved.
This Source Code Form is subject to the terms of the MIT License. If a copy of the MIT was not distributed with this file, You can obtain one at https://github.com/yudeguang17/slice.
DeleteByIndexright 2020 slice Author(https://github.com/yudeguang17/slice). All Rights Reserved.
This Source Code Form is subject to the terms of the MIT License. If a DeleteByIndex of the MIT was not distributed with this file, You can obtain one at https://github.com/yudeguang17/slice.
Copyright 2020 slice Author(https://github.com/yudeguang17/slice). All Rights Reserved.
This Source Code Form is subject to the terms of the MIT License. If a copy of the MIT was not distributed with this file, You can obtain one at https://github.com/yudeguang17/slice.
Copyright 2020 slice Author(https://github.com/yudeguang17/slice). All Rights Reserved.
This Source Code Form is subject to the terms of the MIT License. If a copy of the MIT was not distributed with this file, You can obtain one at https://github.com/yudeguang17/slice.
Copyright 2020 slice Author(https://github.com/yudeguang17/slice). All Rights Reserved.
This Source Code Form is subject to the terms of the MIT License. If a copy of the MIT was not distributed with this file, You can obtain one at https://github.com/yudeguang17/slice.
Copyright 2020 slice Author(https://github.com/yudeguang17/slice). All Rights Reserved.
This Source Code Form is subject to the terms of the MIT License. If a copy of the MIT was not distributed with this file, You can obtain one at https://github.com/yudeguang17/slice.
Copyright 2020 slice Author(https://github.com/yudeguang17/slice). All Rights Reserved.
This Source Code Form is subject to the terms of the MIT License. If a copy of the MIT was not distributed with this file, You can obtain one at https://github.com/yudeguang17/slice.
Copyright 2020 slice Author(https://github.com/yudeguang17/slice). All Rights Reserved.
This Source Code Form is subject to the terms of the MIT License. If a copy of the MIT was not distributed with this file, You can obtain one at https://github.com/yudeguang17/slice.
Reverseright 2020 slice Author(https://github.com/yudeguang17/slice). All Rights Reserved.
This Source Code Form is subject to the terms of the MIT License. If a copy of the MIT was not distributed with this file, You can obtain one at https://github.com/yudeguang17/slice.
Copyright 2020 slice Author(https://github.com/yudeguang17/slice). All Rights Reserved.
This Source Code Form is subject to the terms of the MIT License. If a copy of the MIT was not distributed with this file, You can obtain one at https://github.com/yudeguang17/slice.
Sortright 2020 slice Author(https://github.com/yudeguang17/slice). All Rights Reserved.
This Source Code Form is subject to the terms of the MIT License. If a copy of the MIT was not distributed with this file, You can obtain one at https://github.com/yudeguang17/slice.
Copyright 2020 slice Author(https://github.com/yudeguang17/slice). All Rights Reserved.
This Source Code Form is subject to the terms of the MIT License. If a copy of the MIT was not distributed with this file, You can obtain one at https://github.com/yudeguang17/slice.
Copyright 2020 slice Author(https://github.com/yudeguang17/slice). All Rights Reserved.
This Source Code Form is subject to the terms of the MIT License. If a copy of the MIT was not distributed with this file, You can obtain one at https://github.com/yudeguang17/slice.
Index ¶
- func Contains(s []interface{}, v interface{}) bool
- func ContainsBool(s []bool, v bool) bool
- func ContainsByte(s []byte, v byte) bool
- func ContainsComplex64(s []complex64, v complex64) bool
- func ContainsComplex128(s []complex128, v complex128) bool
- func ContainsFloat32(s []float32, v float32) bool
- func ContainsFloat64(s []float64, v float64) bool
- func ContainsInt(s []int, v int) bool
- func ContainsInt8(s []int8, v int8) bool
- func ContainsInt16(s []int16, v int16) bool
- func ContainsInt32(s []int32, v int32) bool
- func ContainsInt64(s []int64, v int64) bool
- func ContainsRune(s []rune, v rune) bool
- func ContainsString(s []string, v string) bool
- func ContainsUint(s []uint, v uint) bool
- func ContainsUint8(s []uint8, v uint8) bool
- func ContainsUint16(s []uint16, v uint16) bool
- func ContainsUint32(s []uint32, v uint32) bool
- func ContainsUint64(s []uint64, v uint64) bool
- func ContainsUintptr(s []uintptr, v uintptr) bool
- func ContainsUniqueString(s []unique.Handle[string], v unique.Handle[string]) bool
- func Copy(s []interface{}) []interface{}
- func CopyBool(s []bool) []bool
- func CopyByte(s []byte) []byte
- func CopyComplex64(s []complex64) []complex64
- func CopyComplex128(s []complex128) []complex128
- func CopyFloat32(s []float32) []float32
- func CopyFloat64(s []float64) []float64
- func CopyInt(s []int) []int
- func CopyInt8(s []int8) []int8
- func CopyInt16(s []int16) []int16
- func CopyInt32(s []int32) []int32
- func CopyInt64(s []int64) []int64
- func CopyRune(s []rune) []rune
- func CopyString(s []string) []string
- func CopyUint(s []uint) []uint
- func CopyUint8(s []uint8) []uint8
- func CopyUint16(s []uint16) []uint16
- func CopyUint32(s []uint32) []uint32
- func CopyUint64(s []uint64) []uint64
- func CopyUintptr(s []uintptr) []uintptr
- func CopyUniqueString(s []unique.Handle[string]) []unique.Handle[string]
- func DeleteByElement(s []interface{}, element interface{}, num ...int) []interface{}
- func DeleteByElementBool(s []bool, element bool, num ...int) []bool
- func DeleteByElementByte(s []byte, element byte, num ...int) []byte
- func DeleteByElementComplex64(s []complex64, element complex64, num ...int) []complex64
- func DeleteByElementComplex128(s []complex128, element complex128, num ...int) []complex128
- func DeleteByElementFloat32(s []float32, element float32, num ...int) []float32
- func DeleteByElementFloat64(s []float64, element float64, num ...int) []float64
- func DeleteByElementInt(s []int, element int, num ...int) []int
- func DeleteByElementInt8(s []int8, element int8, num ...int) []int8
- func DeleteByElementInt16(s []int16, element int16, num ...int) []int16
- func DeleteByElementInt32(s []int32, element int32, num ...int) []int32
- func DeleteByElementInt64(s []int64, element int64, num ...int) []int64
- func DeleteByElementRune(s []rune, element rune, num ...int) []rune
- func DeleteByElementString(s []string, element string, num ...int) []string
- func DeleteByElementUint(s []uint, element uint, num ...int) []uint
- func DeleteByElementUint8(s []uint8, element uint8, num ...int) []uint8
- func DeleteByElementUint16(s []uint16, element uint16, num ...int) []uint16
- func DeleteByElementUint32(s []uint32, element uint32, num ...int) []uint32
- func DeleteByElementUint64(s []uint64, element uint64, num ...int) []uint64
- func DeleteByElementUintptr(s []uintptr, element uintptr, num ...int) []uintptr
- func DeleteByElementUniqueString(s []unique.Handle[string], element unique.Handle[string], num ...int) []unique.Handle[string]
- func DeleteByIndex(s []interface{}, from int, to ...int) []interface{}
- func DeleteByIndexBool(s []bool, from int, to ...int) []bool
- func DeleteByIndexByte(s []byte, from int, to ...int) []byte
- func DeleteByIndexComplex64(s []complex64, from int, to ...int) []complex64
- func DeleteByIndexComplex128(s []complex128, from int, to ...int) []complex128
- func DeleteByIndexFloat32(s []float32, from int, to ...int) []float32
- func DeleteByIndexFloat64(s []float64, from int, to ...int) []float64
- func DeleteByIndexInt(s []int, from int, to ...int) []int
- func DeleteByIndexInt8(s []int8, from int, to ...int) []int8
- func DeleteByIndexInt16(s []int16, from int, to ...int) []int16
- func DeleteByIndexInt32(s []int32, from int, to ...int) []int32
- func DeleteByIndexInt64(s []int64, from int, to ...int) []int64
- func DeleteByIndexRune(s []rune, from int, to ...int) []rune
- func DeleteByIndexString(s []string, from int, to ...int) []string
- func DeleteByIndexUint(s []uint, from int, to ...int) []uint
- func DeleteByIndexUint8(s []uint8, from int, to ...int) []uint8
- func DeleteByIndexUint16(s []uint16, from int, to ...int) []uint16
- func DeleteByIndexUint32(s []uint32, from int, to ...int) []uint32
- func DeleteByIndexUint64(s []uint64, from int, to ...int) []uint64
- func DeleteByIndexUintptr(s []uintptr, from int, to ...int) []uintptr
- func DeleteByIndexUniqueString(s []unique.Handle[string], from int, to ...int) []unique.Handle[string]
- func Distinct(s []interface{}) []interface{}
- func DistinctBool(s []bool) []bool
- func DistinctByte(s []byte) []byte
- func DistinctComplex64(s []complex64) []complex64
- func DistinctComplex128(s []complex128) []complex128
- func DistinctFloat32(s []float32) []float32
- func DistinctFloat64(s []float64) []float64
- func DistinctInt(s []int) []int
- func DistinctInt8(s []int8) []int8
- func DistinctInt16(s []int16) []int16
- func DistinctInt32(s []int32) []int32
- func DistinctInt64(s []int64) []int64
- func DistinctRune(s []rune) []rune
- func DistinctString(s []string) []string
- func DistinctUint(s []uint) []uint
- func DistinctUint8(s []uint8) []uint8
- func DistinctUint16(s []uint16) []uint16
- func DistinctUint32(s []uint32) []uint32
- func DistinctUint64(s []uint64) []uint64
- func DistinctUintptr(s []uintptr) []uintptr
- func DistinctUniqueString(s []unique.Handle[string]) []unique.Handle[string]
- func Filter(from []interface{}, where func(interface{}) bool) (result []interface{})
- func InnerJoin(m, n []interface{}) []interface{}
- func InnerJoinInt(m, n []int) []int
- func InnerJoinInt8(m, n []int8) []int8
- func InnerJoinInt16(m, n []int16) []int16
- func InnerJoinInt32(m, n []int32) []int32
- func InnerJoinString(m, n []string) []string
- func InnerJoinUniqueString(m, n []unique.Handle[string]) []unique.Handle[string]
- func InsertIgnore(s []interface{}, v interface{}) []interface{}
- func InsertIgnoreBool(s []bool, v bool) []bool
- func InsertIgnoreByte(s []byte, v byte) []byte
- func InsertIgnoreComplex64(s []complex64, v complex64) []complex64
- func InsertIgnoreComplex128(s []complex128, v complex128) []complex128
- func InsertIgnoreFloat32(s []float32, v float32) []float32
- func InsertIgnoreFloat64(s []float64, v float64) []float64
- func InsertIgnoreInt(s []int, v int) []int
- func InsertIgnoreInt8(s []int8, v int8) []int8
- func InsertIgnoreInt16(s []int16, v int16) []int16
- func InsertIgnoreInt32(s []int32, v int32) []int32
- func InsertIgnoreInt64(s []int64, v int64) []int64
- func InsertIgnoreRune(s []rune, v rune) []rune
- func InsertIgnoreString(s []string, v string) []string
- func InsertIgnoreUint(s []uint, v uint) []uint
- func InsertIgnoreUint8(s []uint8, v uint8) []uint8
- func InsertIgnoreUint16(s []uint16, v uint16) []uint16
- func InsertIgnoreUint32(s []uint32, v uint32) []uint32
- func InsertIgnoreUint64(s []uint64, v uint64) []uint64
- func InsertIgnoreUintptr(s []uintptr, v uintptr) []uintptr
- func InsertIgnoreUniqueString(s []unique.Handle[string], v unique.Handle[string]) []unique.Handle[string]
- func Left(s []interface{}, n int) []interface{}
- func LeftBool(s []bool, n int) []bool
- func LeftByte(s []byte, n int) []byte
- func LeftComplex64(s []complex64, n int) []complex64
- func LeftComplex128(s []complex128, n int) []complex128
- func LeftFloat32(s []float32, n int) []float32
- func LeftFloat64(s []float64, n int) []float64
- func LeftInt(s []int, n int) []int
- func LeftInt8(s []int8, n int) []int8
- func LeftInt16(s []int16, n int) []int16
- func LeftInt32(s []int32, n int) []int32
- func LeftInt64(s []int64, n int) []int64
- func LeftRune(s []rune, n int) []rune
- func LeftString(s []string, n int) []string
- func LeftUint(s []uint, n int) []uint
- func LeftUint8(s []uint8, n int) []uint8
- func LeftUint16(s []uint16, n int) []uint16
- func LeftUint32(s []uint32, n int) []uint32
- func LeftUint64(s []uint64, n int) []uint64
- func LeftUintptr(s []uintptr, n int) []uintptr
- func LeftUniqueString(s []unique.Handle[string], n int) []unique.Handle[string]
- func NotIn(m, n []interface{}) (mNotInN []interface{})
- func NotInBool(m, n []bool) (mNotInN []bool)
- func NotInByte(m, n []byte) (mNotInN []byte)
- func NotInComplex64(m, n []complex64) (mNotInN []complex64)
- func NotInComplex128(m, n []complex128) (mNotInN []complex128)
- func NotInFloat32(m, n []float32) (mNotInN []float32)
- func NotInFloat64(m, n []float64) (mNotInN []float64)
- func NotInInt(m, n []int) (mNotInN []int)
- func NotInInt8(m, n []int8) (mNotInN []int8)
- func NotInInt16(m, n []int16) (mNotInN []int16)
- func NotInInt32(m, n []int32) (mNotInN []int32)
- func NotInInt64(m, n []int64) (mNotInN []int64)
- func NotInRune(m, n []rune) (mNotInN []rune)
- func NotInString(m, n []string) (mNotInN []string)
- func NotInUint(m, n []uint) (mNotInN []uint)
- func NotInUint8(m, n []uint8) (mNotInN []uint8)
- func NotInUint16(m, n []uint16) (mNotInN []uint16)
- func NotInUint32(m, n []uint32) (mNotInN []uint32)
- func NotInUint64(m, n []uint64) (mNotInN []uint64)
- func NotInUintptr(m, n []uintptr) (mNotInN []uintptr)
- func NotInUniqueString(m, n []unique.Handle[string]) (mNotInN []unique.Handle[string])
- func ReSethashAlgorithmSwitchNum(n int)
- func Reverse(s []interface{})
- func ReverseBool(s []bool)
- func ReverseByte(s []byte)
- func ReverseComplex64(s []complex64)
- func ReverseComplex128(s []complex128)
- func ReverseFloat32(s []float32)
- func ReverseFloat64(s []float64)
- func ReverseInt(s []int)
- func ReverseInt8(s []int8)
- func ReverseInt16(s []int16)
- func ReverseInt32(s []int32)
- func ReverseInt64(s []int64)
- func ReverseRune(s []rune)
- func ReverseString(s []string)
- func ReverseUint(s []uint)
- func ReverseUint8(s []uint8)
- func ReverseUint16(s []uint16)
- func ReverseUint32(s []uint32)
- func ReverseUint64(s []uint64)
- func ReverseUintptr(s []uintptr)
- func ReverseUniqueString(s []unique.Handle[string])
- func Right(s []interface{}, n int) []interface{}
- func RightBool(s []bool, n int) []bool
- func RightByte(s []byte, n int) []byte
- func RightComplex64(s []complex64, n int) []complex64
- func RightComplex128(s []complex128, n int) []complex128
- func RightFloat32(s []float32, n int) []float32
- func RightFloat64(s []float64, n int) []float64
- func RightInt(s []int, n int) []int
- func RightInt8(s []int8, n int) []int8
- func RightInt16(s []int16, n int) []int16
- func RightInt32(s []int32, n int) []int32
- func RightInt64(s []int64, n int) []int64
- func RightRune(s []rune, n int) []rune
- func RightString(s []string, n int) []string
- func RightUint(s []uint, n int) []uint
- func RightUint8(s []uint8, n int) []uint8
- func RightUint16(s []uint16, n int) []uint16
- func RightUint32(s []uint32, n int) []uint32
- func RightUint64(s []uint64, n int) []uint64
- func RightUintptr(s []uintptr, n int) []uintptr
- func RightUniqueString(s []unique.Handle[string], n int) []unique.Handle[string]
- func Shuffling(s []interface{})
- func ShufflingBool(s []bool)
- func ShufflingByte(s []byte)
- func ShufflingComplex64(s []complex64)
- func ShufflingComplex128(s []complex128)
- func ShufflingFloat32(s []float32)
- func ShufflingFloat64(s []float64)
- func ShufflingInt(s []int)
- func ShufflingInt8(s []int8)
- func ShufflingInt16(s []int16)
- func ShufflingInt32(s []int32)
- func ShufflingInt64(s []int64)
- func ShufflingRune(s []rune)
- func ShufflingString(s []string)
- func ShufflingUinqueString(s []unique.Handle[string])
- func ShufflingUint(s []uint)
- func ShufflingUint8(s []uint8)
- func ShufflingUint16(s []uint16)
- func ShufflingUint32(s []uint32)
- func ShufflingUint64(s []uint64)
- func ShufflingUintptr(s []uintptr)
- func SortByte(s []byte)
- func SortFloat32(s []float32)
- func SortFloat64(s []float64)
- func SortInt(s []int)
- func SortInt8(s []int8)
- func SortInt16(s []int16)
- func SortInt32(s []int32)
- func SortInt64(s []int64)
- func SortRune(s []rune)
- func SortString(s []string)
- func SortUint(s []uint)
- func SortUint8(s []uint8)
- func SortUint16(s []uint16)
- func SortUint32(s []uint32)
- func SortUint64(s []uint64)
- func SortUintptr(s []uintptr)
- func SortUniqueString(s []unique.Handle[string])
- func Union(m, n []interface{}) []interface{}
- func UnionBool(m, n []bool) []bool
- func UnionByte(m, n []byte) []byte
- func UnionComplex64(m, n []complex64) []complex64
- func UnionComplex128(m, n []complex128) []complex128
- func UnionFloat32(m, n []float32) []float32
- func UnionFloat64(m, n []float64) []float64
- func UnionInt(m, n []int) []int
- func UnionInt8(m, n []int8) []int8
- func UnionInt16(m, n []int16) []int16
- func UnionInt32(m, n []int32) []int32
- func UnionInt64(m, n []int64) []int64
- func UnionRune(m, n []rune) []rune
- func UnionString(m, n []string) []string
- func UnionUint(m, n []uint) []uint
- func UnionUint8(m, n []uint8) []uint8
- func UnionUint16(m, n []uint16) []uint16
- func UnionUint32(m, n []uint32) []uint32
- func UnionUint64(m, n []uint64) []uint64
- func UnionUintptr(m, n []uintptr) []uintptr
- func UnionUniqueString(m, n []unique.Handle[string]) []unique.Handle[string]
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ContainsComplex128 ¶
func ContainsComplex128(s []complex128, v complex128) bool
返回切片sli中是否包含单个元素v
func ContainsUniqueString ¶
返回切片sli中是否包含单个元素v
func Copy ¶
func Copy(s []interface{}) []interface{}
see https://github.com/golang/go/wiki/SliceTricks append(s[:0:0], s...) 表示在一个空切片基础上插入s 从数组或者切片派生切片(取子切片)有两以下两种方式 s[low : high] // 双下标形式 s[low : high : max] // 三下标形式 双下标实际是三下标的简写 s[low : high] ==>s[low : high:cap(s)] 以下切片等价 s[0 : len(s)] s[: len(s)] s[0 :] s[:] s[0 : len(s) : cap(s)] s[: len(s) : cap(s)]
安全的复制切片
func CopyUniqueString ¶
返回切片sli中是否包含单个元素v
func DeleteByElement ¶
func DeleteByElement(s []interface{}, element interface{}, num ...int) []interface{}
返回将s中删除前n个元素e后的切片,如果num不填,或者num<0会删除所有子元素e
func DeleteByElementBool ¶
返回将s中删除前n个元素e后的切片,如果num不填,或者num<0会删除所有子元素e
func DeleteByElementByte ¶
返回将s中删除前n个元素e后的切片,如果num不填,或者num<0会删除所有子元素e
func DeleteByElementComplex64 ¶
返回将s中删除前n个元素e后的切片,如果num不填,或者num<0会删除所有子元素e
func DeleteByElementComplex128 ¶
func DeleteByElementComplex128(s []complex128, element complex128, num ...int) []complex128
返回将s中删除前n个元素e后的切片,如果num不填,或者num<0会删除所有子元素e
func DeleteByElementFloat32 ¶
返回将s中删除前n个元素e后的切片,如果num不填,或者num<0会删除所有子元素e
func DeleteByElementFloat64 ¶
返回将s中删除前n个元素e后的切片,如果num不填,或者num<0会删除所有子元素e
func DeleteByElementInt ¶
返回将s中删除前n个元素e后的切片,如果num不填,或者num<0会删除所有子元素e
func DeleteByElementInt8 ¶
返回将s中删除前n个元素e后的切片,如果num不填,或者num<0会删除所有子元素e
func DeleteByElementInt16 ¶
返回将s中删除前n个元素e后的切片,如果num不填,或者num<0会删除所有子元素e
func DeleteByElementInt32 ¶
返回将s中删除前n个元素e后的切片,如果num不填,或者num<0会删除所有子元素e
func DeleteByElementInt64 ¶
返回将s中删除前n个元素e后的切片,如果num不填,或者num<0会删除所有子元素e
func DeleteByElementRune ¶
返回将s中删除前n个元素e后的切片,如果num不填,或者num<0会删除所有子元素e
func DeleteByElementString ¶
返回将s中删除前n个元素e后的切片,如果num不填,或者num<0会删除所有子元素e
func DeleteByElementUint ¶
返回将s中删除前n个元素e后的切片,如果num不填,或者num<0会删除所有子元素e
func DeleteByElementUint8 ¶
返回将s中删除前n个元素e后的切片,如果num不填,或者num<0会删除所有子元素e
func DeleteByElementUint16 ¶
返回将s中删除前n个元素e后的切片,如果num不填,或者num<0会删除所有子元素e
func DeleteByElementUint32 ¶
返回将s中删除前n个元素e后的切片,如果num不填,或者num<0会删除所有子元素e
func DeleteByElementUint64 ¶
返回将s中删除前n个元素e后的切片,如果num不填,或者num<0会删除所有子元素e
func DeleteByElementUintptr ¶
返回将s中删除前n个元素e后的切片,如果num不填,或者num<0会删除所有子元素e
func DeleteByElementUniqueString ¶
func DeleteByElementUniqueString(s []unique.Handle[string], element unique.Handle[string], num ...int) []unique.Handle[string]
返回将s中删除前n个元素e后的切片,如果num不填,或者num<0会删除所有子元素e
func DeleteByIndex ¶
删除从位置是从from(包括)到to(不包括)的相关元素,如果to不填写,则表示只删除from这个位置的一个元素
func DeleteByIndexBool ¶
删除从位置是从from(包括)到to(不包括)的相关元素,如果to不填写,则表示只删除from这个位置的一个元素
func DeleteByIndexByte ¶
删除从位置是从from(包括)到to(不包括)的相关元素,如果to不填写,则表示只删除from这个位置的一个元素
func DeleteByIndexComplex64 ¶
删除从位置是从from(包括)到to(不包括)的相关元素,如果to不填写,则表示只删除from这个位置的一个元素
func DeleteByIndexComplex128 ¶
func DeleteByIndexComplex128(s []complex128, from int, to ...int) []complex128
删除从位置是从from(包括)到to(不包括)的相关元素,如果to不填写,则表示只删除from这个位置的一个元素
func DeleteByIndexFloat32 ¶
删除从位置是从from(包括)到to(不包括)的相关元素,如果to不填写,则表示只删除from这个位置的一个元素
func DeleteByIndexFloat64 ¶
删除从位置是从from(包括)到to(不包括)的相关元素,如果to不填写,则表示只删除from这个位置的一个元素
func DeleteByIndexInt ¶
删除从位置是从from(包括)到to(不包括)的相关元素,如果to不填写,则表示只删除from这个位置的一个元素
func DeleteByIndexInt8 ¶
删除从位置是从from(包括)到to(不包括)的相关元素,如果to不填写,则表示只删除from这个位置的一个元素
func DeleteByIndexInt16 ¶
删除从位置是从from(包括)到to(不包括)的相关元素,如果to不填写,则表示只删除from这个位置的一个元素
func DeleteByIndexInt32 ¶
删除从位置是从from(包括)到to(不包括)的相关元素,如果to不填写,则表示只删除from这个位置的一个元素
func DeleteByIndexInt64 ¶
删除从位置是从from(包括)到to(不包括)的相关元素,如果to不填写,则表示只删除from这个位置的一个元素
func DeleteByIndexRune ¶
删除从位置是从from(包括)到to(不包括)的相关元素,如果to不填写,则表示只删除from这个位置的一个元素
func DeleteByIndexString ¶
删除从位置是从from(包括)到to(不包括)的相关元素,如果to不填写,则表示只删除from这个位置的一个元素
func DeleteByIndexUint ¶
删除从位置是从from(包括)到to(不包括)的相关元素,如果to不填写,则表示只删除from这个位置的一个元素
func DeleteByIndexUint8 ¶
删除从位置是从from(包括)到to(不包括)的相关元素,如果to不填写,则表示只删除from这个位置的一个元素
func DeleteByIndexUint16 ¶
删除从位置是从from(包括)到to(不包括)的相关元素,如果to不填写,则表示只删除from这个位置的一个元素
func DeleteByIndexUint32 ¶
删除从位置是从from(包括)到to(不包括)的相关元素,如果to不填写,则表示只删除from这个位置的一个元素
func DeleteByIndexUint64 ¶
删除从位置是从from(包括)到to(不包括)的相关元素,如果to不填写,则表示只删除from这个位置的一个元素
func DeleteByIndexUintptr ¶
删除从位置是从from(包括)到to(不包括)的相关元素,如果to不填写,则表示只删除from这个位置的一个元素
func DeleteByIndexUniqueString ¶
func DeleteByIndexUniqueString(s []unique.Handle[string], from int, to ...int) []unique.Handle[string]
删除从位置是从from(包括)到to(不包括)的相关元素,如果to不填写,则表示只删除from这个位置的一个元素
func DistinctUniqueString ¶
返回去重复后的数据
func Filter ¶
func Filter(from []interface{}, where func(interface{}) bool) (result []interface{})
切片筛选通用函数
//结构体
type Student struct {
Name string
Age int
Height int
}
//样本数据
Students := []Student{
Student{"Danny", 15, 165},
Student{"Jacky", 16, 180},
Student{"Alan", 17, 172},
Student{"Sandy", 18, 168},
}
//循环匹配主函数
func Filter(from []Student, where func(Student) bool) (result []Student) {
for _, line := range from {
if where(line) {
result = append(result, line)
}
}
return result
}
//匹配条件函数
func Where() func(Student) bool {
return func(s Student) bool {
return (s.Age > 15) && (s.Height > 170)
}
}
func InnerJoinUniqueString ¶
返回去重复后两个切片的交集
func InsertIgnore ¶
func InsertIgnore(s []interface{}, v interface{}) []interface{}
向切片Sli中插入没出现过的元素V,如果切片中有V,则不插入
func InsertIgnoreBool ¶
向切片Sli中插入没出现过的元素V,如果切片中有V,则不插入
func InsertIgnoreByte ¶
向切片Sli中插入没出现过的元素V,如果切片中有V,则不插入
func InsertIgnoreComplex64 ¶
向切片Sli中插入没出现过的元素V,如果切片中有V,则不插入
func InsertIgnoreComplex128 ¶
func InsertIgnoreComplex128(s []complex128, v complex128) []complex128
向切片Sli中插入没出现过的元素V,如果切片中有V,则不插入
func InsertIgnoreFloat32 ¶
向切片Sli中插入没出现过的元素V,如果切片中有V,则不插入
func InsertIgnoreFloat64 ¶
向切片Sli中插入没出现过的元素V,如果切片中有V,则不插入
func InsertIgnoreInt8 ¶
向切片Sli中插入没出现过的元素V,如果切片中有V,则不插入
func InsertIgnoreInt16 ¶
向切片Sli中插入没出现过的元素V,如果切片中有V,则不插入
func InsertIgnoreInt32 ¶
向切片Sli中插入没出现过的元素V,如果切片中有V,则不插入
func InsertIgnoreInt64 ¶
向切片Sli中插入没出现过的元素V,如果切片中有V,则不插入
func InsertIgnoreRune ¶
向切片Sli中插入没出现过的元素V,如果切片中有V,则不插入
func InsertIgnoreString ¶
向切片Sli中插入没出现过的元素V,如果切片中有V,则不插入
func InsertIgnoreUint ¶
向切片Sli中插入没出现过的元素V,如果切片中有V,则不插入
func InsertIgnoreUint8 ¶
向切片Sli中插入没出现过的元素V,如果切片中有V,则不插入
func InsertIgnoreUint16 ¶
向切片Sli中插入没出现过的元素V,如果切片中有V,则不插入
func InsertIgnoreUint32 ¶
向切片Sli中插入没出现过的元素V,如果切片中有V,则不插入
func InsertIgnoreUint64 ¶
向切片Sli中插入没出现过的元素V,如果切片中有V,则不插入
func InsertIgnoreUintptr ¶
向切片Sli中插入没出现过的元素V,如果切片中有V,则不插入
func InsertIgnoreUniqueString ¶
func InsertIgnoreUniqueString(s []unique.Handle[string], v unique.Handle[string]) []unique.Handle[string]
向切片Sli中插入没出现过的元素V,如果切片中有V,则不插入
func LeftUniqueString ¶
返回从左往右最多n个元素
func NotIn ¶
func NotIn(m, n []interface{}) (mNotInN []interface{})
返回集合m不在集合n中的所有值,也即m-n,注意在此不对m做去重操作
func NotInComplex64 ¶
返回集合m不在集合n中的所有值,也即m-n,注意在此不对m做去重操作
func NotInComplex128 ¶
func NotInComplex128(m, n []complex128) (mNotInN []complex128)
返回集合m不在集合n中的所有值,也即m-n,注意在此不对m做去重操作
func NotInFloat32 ¶
返回集合m不在集合n中的所有值,也即m-n,注意在此不对m做去重操作
func NotInFloat64 ¶
返回集合m不在集合n中的所有值,也即m-n,注意在此不对m做去重操作
func NotInInt16 ¶
返回集合m不在集合n中的所有值,也即m-n,注意在此不对m做去重操作
func NotInInt32 ¶
返回集合m不在集合n中的所有值,也即m-n,注意在此不对m做去重操作
func NotInInt64 ¶
返回集合m不在集合n中的所有值,也即m-n,注意在此不对m做去重操作
func NotInString ¶
返回集合m不在集合n中的所有值,也即m-n,注意在此不对m做去重操作
func NotInUint8 ¶
返回集合m不在集合n中的所有值,也即m-n,注意在此不对m做去重操作
func NotInUint16 ¶
返回集合m不在集合n中的所有值,也即m-n,注意在此不对m做去重操作
func NotInUint32 ¶
返回集合m不在集合n中的所有值,也即m-n,注意在此不对m做去重操作
func NotInUint64 ¶
返回集合m不在集合n中的所有值,也即m-n,注意在此不对m做去重操作
func NotInUintptr ¶
返回集合m不在集合n中的所有值,也即m-n,注意在此不对m做去重操作
func NotInUniqueString ¶
返回集合m不在集合n中的所有值,也即m-n,注意在此不对m做去重操作
func RightUniqueString ¶
返回右往左最多n个元素
func Shuffling ¶
func Shuffling(s []interface{})
https://github.com/golang/go/wiki/SliceTricks
go官方的案例如下,注意一定要先执行rand.Seed(time.Now().UnixNano())
for i := len(a) - 1; i > 0; i-- {
j := rand.Intn(i + 1)
a[i], a[j] = a[j], a[i]
}
返回随机打乱后的切片
func SortString ¶
func SortString(s []string)
func Sort(s []interface{}) []interface{} {
sort.Slice(s, func(i, j int) bool {
return s[i] < s[j]
})
return s
}
切片排序
func SortUniqueString ¶
//切片排序
func SortBool(s []bool) {
sort.Slice(s, func(i, j int) bool {
return s[i] < s[j]
})
}
切片排序
func Union ¶
func Union(m, n []interface{}) []interface{}
获得两个切片去重后的合集,也即m+n,注意union 与 union all的区别,这里并不实现union all
func UnionComplex64 ¶
获得两个切片去重后的合集,也即m+n,注意union 与 union all的区别,这里并不实现union all
func UnionComplex128 ¶
func UnionComplex128(m, n []complex128) []complex128
获得两个切片去重后的合集,也即m+n,注意union 与 union all的区别,这里并不实现union all
func UnionFloat32 ¶
获得两个切片去重后的合集,也即m+n,注意union 与 union all的区别,这里并不实现union all
func UnionFloat64 ¶
获得两个切片去重后的合集,也即m+n,注意union 与 union all的区别,这里并不实现union all
func UnionInt16 ¶
获得两个切片去重后的合集,也即m+n,注意union 与 union all的区别,这里并不实现union all
func UnionInt32 ¶
获得两个切片去重后的合集,也即m+n,注意union 与 union all的区别,这里并不实现union all
func UnionInt64 ¶
获得两个切片去重后的合集,也即m+n,注意union 与 union all的区别,这里并不实现union all
func UnionString ¶
获得两个切片去重后的合集,也即m+n,注意union 与 union all的区别,这里并不实现union all
func UnionUint8 ¶
获得两个切片去重后的合集,也即m+n,注意union 与 union all的区别,这里并不实现union all
func UnionUint16 ¶
获得两个切片去重后的合集,也即m+n,注意union 与 union all的区别,这里并不实现union all
func UnionUint32 ¶
获得两个切片去重后的合集,也即m+n,注意union 与 union all的区别,这里并不实现union all
func UnionUint64 ¶
获得两个切片去重后的合集,也即m+n,注意union 与 union all的区别,这里并不实现union all
func UnionUintptr ¶
获得两个切片去重后的合集,也即m+n,注意union 与 union all的区别,这里并不实现union all
Types ¶
This section is empty.