sliceutils

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Feb 13, 2021 License: Apache-2.0 Imports: 0 Imported by: 1

Documentation

Overview

Useful functions for dealing with slices https://gobyexample.com/collection-functions

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func All

func All(vs []string, f func(string) bool) bool

All returns true if every one of the strings in vs satisfies f

func Any

func Any(vs []string, f func(string) bool) bool

Any returns true if one of the strings in vs satisfies f

func Filter

func Filter(vs []string, f func(string) bool) []string

Filter returns a new slice containing all the strings in vs that satisfy f

func Includes

func Includes(vs []string, t string) bool

Includes returns true if t is contained within vs

func Index

func Index(vs []string, t string) int

Index returns the first index of t or -1 if no match

func Map

func Map(vs []string, f func(string) string) []string

Map returns a new slice containing the results of applying f to each string in vs

Types

This section is empty.

Jump to

Keyboard shortcuts

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