collection

package
v1.1.1 Latest Latest
Warning

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

Go to latest
Published: Mar 18, 2023 License: MIT Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DiffSlice

func DiffSlice(a, b []string) []string

func InInt

func InInt(find int, arr []int) bool

func InSlice added in v1.0.5

func InSlice(need, haystack interface{}) bool

多元化判断

func InStr

func InStr(find string, arr []string) bool

func MaxSlice added in v1.0.5

func MaxSlice(v []int64) (m int64)

func MinSlice added in v1.0.5

func MinSlice(v []int64) (m int64)

Types

type MapSorter

type MapSorter struct {
	Keys []string
	Vals []string
}

map sort

func NewMapSorter

func NewMapSorter(m map[string]string) *MapSorter

func (*MapSorter) Len

func (ms *MapSorter) Len() int

func (*MapSorter) Less

func (ms *MapSorter) Less(i, j int) bool

func (*MapSorter) Sort

func (ms *MapSorter) Sort()

func (*MapSorter) Swap

func (ms *MapSorter) Swap(i, j int)

type StrMap

type StrMap map[string]string

func (StrMap) Keys

func (this StrMap) Keys() []string

func (StrMap) ToInterface

func (this StrMap) ToInterface() map[string]interface{}

type StrMaps

type StrMaps []map[string]string

func (StrMaps) IndexBy

func (this StrMaps) IndexBy(indexKey string, keys ...string) map[string]map[string]string

[] map[string]string => map[string] map[string]string

func (StrMaps) Pluck

func (this StrMaps) Pluck(indexKey string, valueKey string) map[string]string

[] map[string]string => map[string]string

Jump to

Keyboard shortcuts

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