slic

package
v0.0.0-...-e8acdfa Latest Latest
Warning

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

Go to latest
Published: Apr 16, 2018 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Contains

func Contains(haystack []interface{}, needle interface{}) bool

func ContainsString

func ContainsString(haystack []string, needle string) bool

func Extract

func Extract(slice interface{}, fldName string) []interface{}

Extract fetches the given field value from all the items of the slice.

func Find

func Find(slice interface{}, fldName string, fldValue interface{}) []interface{}

Find returns all the matching items of a slice where the Field name has the given value

func FindOne

func FindOne(slice interface{}, fldName string, fldValue interface{}) interface{}

FindOne returns the first item that has the given field, and given value for that field. Returns nil otherwise

func Group

func Group(slice interface{}, fldName string) map[string][]interface{}

Group groups the given slice into chunks as per the values of the given field name

Types

This section is empty.

Jump to

Keyboard shortcuts

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