sliceutil

package
v12.12.0+incompatible Latest Latest
Warning

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

Go to latest
Published: Dec 30, 2020 License: Apache-2.0 Imports: 1 Imported by: 0

Documentation

Overview

Package sliceutil provides methods for working with slices

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Contains

func Contains(slice []string, value string) bool

Contains checks if string slice contains some value

func Deduplicate

func Deduplicate(slice []string) []string

Deduplicate removes duplicates from slice. Slice must be sorted before deduplication.

func ErrorToString

func ErrorToString(data []error) []string

ErrorToString converts slice with errors to slice with strings

func Exclude

func Exclude(slice, items []string) []string

Exclude returns slice without items in second given slice

func Index

func Index(slice []string, item string) int

Index returns index of given item in a slice or -1 otherwise

func IntToInterface

func IntToInterface(data []int) []interface{}

IntToInterface converts slice with ints to slice with interface{}

func StringToError

func StringToError(data []string) []error

StringToError converts slice with strings to slice with errors

func StringToInterface

func StringToInterface(data []string) []interface{}

StringToInterface converts slice with strings to slice with interface{}

Types

This section is empty.

Jump to

Keyboard shortcuts

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