array

package
v0.1.3 Latest Latest
Warning

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

Go to latest
Published: Feb 24, 2021 License: MIT Imports: 0 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Any

func Any(list []interface{}, compare CompareFunc) bool

Any return if any item in list that satisfies the provided testing function

func Contain

func Contain(list []interface{}, target interface{}) bool

Contain return if list contain the target element

func Filter

func Filter(list []interface{}, compare CompareFunc) []interface{}

Filter return all values in the array that satisfies the provided testing function

func FindIndex

func FindIndex(list []interface{}, compare CompareFunc) int

FindIndex returns the index of the first element in the array that satisfies the provided testing function

func First

func First(list []interface{}, compare CompareFunc) interface{}

First return the value of the first element in the array that satisfies the provided testing function

func IndexOf

func IndexOf(list []interface{}, target interface{}) int

IndexOf returns the first index at which a given element can be found in the

func IntsToInterfaces

func IntsToInterfaces(a []int) []interface{}

IntsToInterfaces used to conv int array to interface array

func Map

func Map(list []interface{}, conv ConvFunc) []interface{}

Map return all the converted value by conv function from the element in the list

func StringsToInterfaces

func StringsToInterfaces(a []string) []interface{}

StringsToInterfaces used to conv string array to interface array

Types

type CompareFunc

type CompareFunc func(item interface{}) bool

CompareFunc used to express compare item fit some conditions

type ConvFunc

type ConvFunc func(item interface{}) interface{}

ConvFunc used conv item to another

Jump to

Keyboard shortcuts

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