slices

package module
Version: v0.0.0-...-553769f Latest Latest
Warning

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

Go to latest
Published: Jul 13, 2018 License: MIT Imports: 3 Imported by: 5

README

slices

Go package to work with slices

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func EqualStrings

func EqualStrings(s1, s2 []string) bool

func IsInInt64Slice

func IsInInt64Slice(v int64, s []int64) bool

func IsInStringSlice

func IsInStringSlice(v string, s []string) bool

func MergeInt64s

func MergeInt64s(source []int64, slices ...[]int64) (result []int64, changed bool)

func MergeStrings

func MergeStrings(source []string, slices ...[]string) (result []string, changed bool)

func RemoveInt64s

func RemoveInt64s(source, remove []int64) (result []int64, removed int)

func RemoveStrings

func RemoveStrings(source, remove []string) (result []string, removed int)

func Shuffle

func Shuffle(r *rand.Rand, n int, swap func(i, j int))

Shuffle pseudo-randomizes the order of elements. n is the number of elements. Shuffle panics if n < 0. swap swaps the elements with indexes i and j.

Types

type CommaSeparatedUniqueValuesList

type CommaSeparatedUniqueValuesList string

func (CommaSeparatedUniqueValuesList) Add

func (CommaSeparatedUniqueValuesList) Contains

func (csv CommaSeparatedUniqueValuesList) Contains(v string) bool

func (CommaSeparatedUniqueValuesList) Remove

func (CommaSeparatedUniqueValuesList) String

func (CommaSeparatedUniqueValuesList) Strings

func (csv CommaSeparatedUniqueValuesList) Strings() []string

type CommaSeparatedValuesList

type CommaSeparatedValuesList string

func (CommaSeparatedValuesList) Add

func (CommaSeparatedValuesList) Contains

func (csv CommaSeparatedValuesList) Contains(v string) bool

func (CommaSeparatedValuesList) Count

func (csv CommaSeparatedValuesList) Count() int

func (CommaSeparatedValuesList) Remove

func (CommaSeparatedValuesList) Set

func (CommaSeparatedValuesList) String

func (csv CommaSeparatedValuesList) String() string

func (CommaSeparatedValuesList) Strings

func (csv CommaSeparatedValuesList) Strings() []string

Jump to

Keyboard shortcuts

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