slice

package
v1.2.1 Latest Latest
Warning

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

Go to latest
Published: Aug 12, 2022 License: MIT Imports: 1 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// NotFoundTag ... indicate an element is not found
	NotFoundTag = -1
)

Variables

This section is empty.

Functions

func ApplyInt32s

func ApplyInt32s(l []int32, applyFunc func(n int32) int32)

ApplyInt32s ... Apply a function to each element in int32 slice

func ApplyInt64s

func ApplyInt64s(l []int64, applyFunc func(n int64) int64)

ApplyInt64s ... Apply a function to each element in int64 slice

func ApplyStrings

func ApplyStrings(l []string, applyFunc func(s string) string)

ApplyStrings ... Apply a function to each element in string slice

func ApplyUint32s

func ApplyUint32s(l []uint32, applyFunc func(n uint32) uint32)

ApplyUint32s ... Apply a function to each element in uint32 slice

func ApplyUint64s

func ApplyUint64s(l []uint64, applyFunc func(n uint64) uint64)

ApplyUint64s ... Apply a function to each element in uint64 slice

func IApplyInt32s

func IApplyInt32s(l []int32, applyFunc func(i int, n int32) int32)

IApplyInt32s ... Apply an index-related function to each element in int32 slice

func IApplyInt64s

func IApplyInt64s(l []int64, applyFunc func(i int, n int64) int64)

IApplyInt64s ... Apply an index-related function to each element in int64 slice

func IApplyStrings

func IApplyStrings(l []string, applyFunc func(i int, s string) string)

IApplyStrings ... Apply an index-related function to each element in string slice

func IApplyUint32s

func IApplyUint32s(l []uint32, applyFunc func(i int, n uint32) uint32)

IApplyUint32s ... Apply an index-related function to each element in uint32 slice

func IApplyUint64s

func IApplyUint64s(l []uint64, applyFunc func(i int, n uint64) uint64)

IApplyUint64s ... Apply an index-related function to each element in uint64 slice

func InInt32s

func InInt32s(l []int32, nums ...int32) bool

InInt32s ... Check if all int32 num in int32 slice

func InInt64s

func InInt64s(l []int64, nums ...int64) bool

InInt64s ... Check if all int64 num in int64 slice

func InStrings

func InStrings(l []string, s ...string) bool

InStrings ... Check if all strings in string slice

func InUint32s

func InUint32s(l []uint32, nums ...uint32) bool

InUint32s ... Check if all uint32 num in uint32 slice

func InUint64s

func InUint64s(l []uint64, nums ...uint64) bool

InUint64s ... Check if all uint64 num in uint64 slice

func IndexAllInt32s

func IndexAllInt32s(l []int32, nums ...int32) map[int32]int

IndexAllInt32s ... Find all positions of int32 nums in int32 slice and returns a maps (key: given nums, value: their positions, -1 if not found)

func IndexAllInt64s

func IndexAllInt64s(l []int64, nums ...int64) map[int64]int

IndexAllInt64s ... Find all positions of int64 nums in int64 slice and returns a maps (key: given nums, value: their positions, -1 if not found)

func IndexAllStrings

func IndexAllStrings(l []string, s ...string) map[string]int

IndexAllStrings ... Find all positions of int64 nums in int64 slice... returns a maps (key: given nums, value: their positions, -1 if not found)

func IndexAllUint32s

func IndexAllUint32s(l []uint32, nums ...uint32) map[uint32]int

IndexAllUint32s ... Find all positions of uint32 nums in uint32 slice and returns a maps (key: given nums, value: their positions, -1 if not found)

func IndexAllUint64s

func IndexAllUint64s(l []uint64, nums ...uint64) map[uint64]int

IndexAllUint64s ... Find all positions of uint64 nums in uint64 slice and returns a maps (key: given nums, value: their positions, -1 if not found)

func IndexInt32s

func IndexInt32s(l []int32, num int32) int

IndexInt32s ... Find the position of int32 num in int32 slice, return -1 if not found

func IndexInt64s

func IndexInt64s(l []int64, num int64) int

IndexInt64s ... Find the position of int64 num in int64 slice, return -1 if not found

func IndexStrings

func IndexStrings(l []string, s string) int

IndexStrings ... Find the position of string in string slice, return -1 if not found

func IndexUint32s

func IndexUint32s(l []uint32, num uint32) int

IndexUint32s ... Find the position of uint32 num in uint32 slice, return -1 if not found

func IndexUint64s

func IndexUint64s(l []uint64, num uint64) int

IndexUint64s ... Find the position of uint64 num in uint64 slice, return -1 if not found

func MergeInt32s

func MergeInt32s(l ...[]int32) []int32

MergeInt32s ... Merge int32 slices into one int32 slice

func MergeInt64s

func MergeInt64s(l ...[]int64) []int64

MergeInt64s ... Merge int64 slices into one int64 slice

func MergeStrings

func MergeStrings(l ...[]string) []string

MergeStrings ... Merge string slices into one string slice

func MergeUint32s

func MergeUint32s(l ...[]uint32) []uint32

MergeUint32s ... Merge uint32 slices into one uint32 slice

func MergeUint64s

func MergeUint64s(l ...[]uint64) []uint64

MergeUint64s ... Merge uint64 slices into one uint64 slice

func OneInInt32s added in v1.0.1

func OneInInt32s(l []int32, nums ...int32) bool

OneInInt32s ... Check if at least one int32 num in int32 slice

func OneInInt64s added in v1.0.1

func OneInInt64s(l []int64, nums ...int64) bool

OneInInt64s ... Check if at least one int64 num in int64 slice

func OneInStrings added in v1.0.1

func OneInStrings(l []string, s ...string) bool

OneInStrings ... Check if at least one string in string slice

func OneInUint32s added in v1.0.1

func OneInUint32s(l []uint32, nums ...uint32) bool

OneInUint32s ... Check if at least one uint32 num in uint32 slice

func OneInUint64s added in v1.0.1

func OneInUint64s(l []uint64, nums ...uint64) bool

OneInUint64s ... Check if at least one uint64 num in uint64 slice

func RSortBytesByLen added in v1.0.1

func RSortBytesByLen(l [][]byte)

RSortBytesByLen ... Reverse stable sort bytes slice by length of each bytes

func RSortInt32s

func RSortInt32s(l []int32)

RSortInt32s ... Reverse stable sort int32 slice

func RSortInt64s

func RSortInt64s(l []int64)

RSortInt64s ... Reverse stable sort int64 slice

func RSortStringsByLen

func RSortStringsByLen(l []string)

RSortStringsByLen ... Reverse stable sort string slice by length of each string

func RSortUint32s

func RSortUint32s(l []uint32)

RSortUint32s ... Reverse stable sort uint32 slice

func RSortUint64s

func RSortUint64s(l []uint64)

RSortUint64s ... Reverse stable sort uint64 slice

func ReverseInt32s added in v1.0.1

func ReverseInt32s(l []int32)

ReverseInt32s ... Reverse int32 slice in-place

func ReverseInt64s added in v1.0.1

func ReverseInt64s(l []int64)

ReverseInt64s ... Reverse int64 slice in-place

func ReverseStrings added in v1.0.1

func ReverseStrings(l []string)

ReverseStrings ... Reverse string slice in-place

func ReverseUint32s added in v1.0.1

func ReverseUint32s(l []uint32)

ReverseUint32s ... Reverse uint32 slice in-place

func ReverseUint64s added in v1.0.1

func ReverseUint64s(l []uint64)

ReverseUint64s ... Reverse uint64 slice in-place

func SortBytesByLen added in v1.0.1

func SortBytesByLen(l [][]byte)

SortBytesByLen ... Stable sort bytes slice by length of each bytes

func SortInt32s

func SortInt32s(l []int32)

SortInt32s ... Stable sort int32 slice

func SortInt64s

func SortInt64s(l []int64)

SortInt64s ... Stable sort int64 slice

func SortStringsByLen

func SortStringsByLen(l []string)

SortStringsByLen ... Stable sort string slice by length of each string

func SortUint32s

func SortUint32s(l []uint32)

SortUint32s ... Stable sort uint32 slice

func SortUint64s

func SortUint64s(l []uint64)

SortUint64s ... Stable sort uint64 slice

func UniqueInt32s

func UniqueInt32s(l []int32) []int32

UniqueInt32s ... Return a unique copy of given int32 slice

func UniqueInt64s

func UniqueInt64s(l []int64) []int64

UniqueInt64s ... Return a unique copy of given int64 slice

func UniqueMergeInt32s

func UniqueMergeInt32s(l ...[]int32) []int32

UniqueMergeInt32s ... Merge int32 slices into one int32 slice, excluding duplicated elements

func UniqueMergeInt64s

func UniqueMergeInt64s(l ...[]int64) []int64

UniqueMergeInt64s ... Merge int64 slices into one int64 slice, excluding duplicated elements

func UniqueMergeStrings

func UniqueMergeStrings(l ...[]string) []string

UniqueMergeStrings ... Merge string slices into one string slice, excluding duplicated elements

func UniqueMergeUint32s

func UniqueMergeUint32s(l ...[]uint32) []uint32

UniqueMergeUint32s ... Merge uint32 slices into one uint32 slice, excluding duplicated elements

func UniqueMergeUint64s

func UniqueMergeUint64s(l ...[]uint64) []uint64

UniqueMergeUint64s ... Merge uint64 slices into one uint64 slice, excluding duplicated elements

func UniqueStrings

func UniqueStrings(l []string) []string

UniqueStrings ... Return a unique copy of given string slice

func UniqueUint32s

func UniqueUint32s(l []uint32) []uint32

UniqueUint32s ... Return a unique copy of given uint32 slice

func UniqueUint64s

func UniqueUint64s(l []uint64) []uint64

UniqueUint64s ... Return a unique copy of given uint64 slice

Types

This section is empty.

Jump to

Keyboard shortcuts

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