slices

package
v1.5.2 Latest Latest
Warning

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

Go to latest
Published: Sep 21, 2022 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AllFloat32s

func AllFloat32s(s []float32, fn func(v float32) bool) bool

AllFloat32s applies a fn to each element of s (if s is empty, returns false), if all elements make that fn return true then AllFloat32s will return true, else return false.

func AllFloat64s

func AllFloat64s(s []float64, fn func(v float64) bool) bool

AllFloat64s applies a fn to each element of s (if s is empty, returns false), if all elements make that fn return true then AllFloat64s will return true, else return false.

func AllInt16s

func AllInt16s(s []int16, fn func(v int16) bool) bool

AllInt16s applies a fn to each element of s (if s is empty, returns false), if all elements make that fn return true then AllInt16s will return true, else return false.

func AllInt32s

func AllInt32s(s []int32, fn func(v int32) bool) bool

AllInt32s applies a fn to each element of s (if s is empty, returns false), if all elements make that fn return true then AllInt32s will return true, else return false.

func AllInt64s

func AllInt64s(s []int64, fn func(v int64) bool) bool

AllInt64s applies a fn to each element of s (if s is empty, returns false), if all elements make that fn return true then AllInt64s will return true, else return false.

func AllInt8s

func AllInt8s(s []int8, fn func(v int8) bool) bool

AllInt8s applies a fn to each element of s (if s is empty, returns false), if all elements make that fn return true then AllInt8s will return true, else return false.

func AllInts

func AllInts(s []int, fn func(v int) bool) bool

AllInts applies a fn to each element of s (if s is empty, returns false), if all elements make that fn return true then AllInts will return true, else return false.

func AllStrings

func AllStrings(s []string, fn func(v string) bool) bool

AllStrings applies a fn to each element of s (if s is empty, returns false), if all elements make that fn return true then AllStrings will return true, else return false.

func AnyFloat32s

func AnyFloat32s(s []float32, fn func(v float32) bool) bool

AnyFloat32s applies a fn to each element of s (if s is empty, returns false), if there exist at least one element make that fn return true then AnyFloat32s will return true, else return false.

func AnyFloat64s

func AnyFloat64s(s []float64, fn func(v float64) bool) bool

AnyFloat64s applies a fn to each element of s (if s is empty, returns false), if there exist at least one element make that fn return true then AnyFloat64s will return true, else return false.

func AnyInt16s

func AnyInt16s(s []int16, fn func(v int16) bool) bool

AnyInt16s applies a fn to each element of s (if s is empty, returns false), if there exist at least one element make that fn return true then AnyInt16s will return true, else return false.

func AnyInt32s

func AnyInt32s(s []int32, fn func(v int32) bool) bool

AnyInt32s applies a fn to each element of s (if s is empty, returns false), if there exist at least one element make that fn return true then AnyInt32s will return true, else return false.

func AnyInt64s

func AnyInt64s(s []int64, fn func(v int64) bool) bool

AnyInt64s applies a fn to each element of s (if s is empty, returns false), if there exist at least one element make that fn return true then AnyInt64s will return true, else return false.

func AnyInt8s

func AnyInt8s(s []int8, fn func(v int8) bool) bool

AnyInt8s applies a fn to each element of s (if s is empty, returns false), if there exist at least one element make that fn return true then AnyInt8s will return true, else return false.

func AnyInts

func AnyInts(s []int, fn func(v int) bool) bool

AnyInts applies a fn to each element of s (if s is empty, returns false), if there exist at least one element make that fn return true then AnyInts will return true, else return false.

func AnyStrings

func AnyStrings(s []string, fn func(v string) bool) bool

AnyStrings applies a fn to each element of s (if s is empty, returns false), if there exist at least one element make that fn return true then AnyStrings will return true, else return false.

func ContainFloat32s

func ContainFloat32s(s []float32, e float32) bool

ContainFloat32s returns true if s contain e.

func ContainFloat64s

func ContainFloat64s(s []float64, e float64) bool

ContainFloat64s returns true if s contain e.

func ContainInt16s

func ContainInt16s(s []int16, e int16) bool

ContainInt16s returns true if s contain e.

func ContainInt32s

func ContainInt32s(s []int32, e int32) bool

ContainInt32s returns true if s contain e.

func ContainInt64s

func ContainInt64s(s []int64, e int64) bool

ContainInt64s returns true if s contain e.

func ContainInt8s

func ContainInt8s(s []int8, e int8) bool

ContainInt8s returns true if s contain e.

func ContainInts

func ContainInts(s []int, e int) bool

ContainInts returns true if s contain e.

func ContainStrings

func ContainStrings(s []string, e string) bool

ContainStrings returns true if s contain e.

func ContainStringsIgnoreCase

func ContainStringsIgnoreCase(s []string, e string) bool

ContainStringsIgnoreCase returns true if s contain e, ignore case of element.

func DistinctFloat32s

func DistinctFloat32s(s []float32) []float32

DistinctFloat32s remove duplicate element in slices.

func DistinctFloat64s

func DistinctFloat64s(s []float64) []float64

DistinctFloat64s remove duplicate element in slices.

func DistinctInt16s

func DistinctInt16s(s []int16) []int16

DistinctInt16s remove duplicate element in slices.

func DistinctInt32s

func DistinctInt32s(s []int32) []int32

DistinctInt32s remove duplicate element in slices.

func DistinctInt64s

func DistinctInt64s(s []int64) []int64

DistinctInt64s remove duplicate element in slices.

func DistinctInt8s

func DistinctInt8s(s []int8) []int8

DistinctInt8s remove duplicate element in slices.

func DistinctInts

func DistinctInts(s []int) []int

DistinctInts remove duplicate element in slices.

func DistinctStrings

func DistinctStrings(s []string) []string

DistinctStrings remove duplicate element in slices.

func FilterFloat32s

func FilterFloat32s(s []float32, fn func(v float32) bool) []float32

FilterFloat32s applies a fn to each element of s, return a slices of make fn true.

func FilterFloat64s

func FilterFloat64s(s []float64, fn func(v float64) bool) []float64

FilterFloat64s applies a fn to each element of s, return a slices of make fn true.

func FilterInt16s

func FilterInt16s(s []int16, fn func(v int16) bool) []int16

FilterInt16s applies a fn to each element of s, return a slices of make fn true.

func FilterInt32s

func FilterInt32s(s []int32, fn func(v int32) bool) []int32

FilterInt32s applies a fn to each element of s, return a slices of make fn true.

func FilterInt64s

func FilterInt64s(s []int64, fn func(v int64) bool) []int64

FilterInt64s applies a fn to each element of s, return a slices of make fn true.

func FilterInt8s

func FilterInt8s(s []int8, fn func(v int8) bool) []int8

FilterInt8s applies a fn to each element of s, return a slices of make fn true.

func FilterInts

func FilterInts(s []int, fn func(v int) bool) []int

FilterInts applies a fn to each element of s, return a slices of make fn true.

func FilterStrings

func FilterStrings(s []string, fn func(v string) bool) []string

FilterStrings applies a fn to each element of s, return a slices of make fn true.

func Page

func Page(arr interface{}, pageNum, pageLimit int) (interface{}, bool)

Page slice and returns the current page results and hasNext mark. Param of arr must be a slice and returns nil slice when: (pageNum - 1) * pageLimit > len(arr). Panics when:

  1. arr type is unexpected type,
  2. param: pageNum <= 0 or pageLimit <= 0.

Types

This section is empty.

Jump to

Keyboard shortcuts

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