slice

package
v0.0.0-...-1fccfa7 Latest Latest
Warning

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

Go to latest
Published: Jun 1, 2024 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ContainsAll

func ContainsAll[C comparable](haystack []C, needles ...C) bool

func ContainsAny

func ContainsAny[C comparable](haystack []C, needles ...C) bool

func HasString

func HasString(ss []string, s string) bool

@todo replace with ContainsAny

func HasUint64

func HasUint64(ss []uint64, s uint64) bool

func IntersectStrings

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

func Keys

func Keys(m interface{}) (kk []string)

Keys returns sorted map keys

If input is not a map it will return an empty slice

func PluckString

func PluckString(ss []string, ff ...string) (o []string)

RemoveString removes one or more strings form the input slice

func ToStringBoolMap

func ToStringBoolMap(s []string) (h map[string]bool)

func ToUint64BoolMap

func ToUint64BoolMap(u []uint64) (h map[uint64]bool)

Types

type UInt64s

type UInt64s []uint64

UInt64s represents slice of uint64 with some extra powers:

  • encodes (JSON) uint64s as strings

func (UInt64s) MarshalJSON

func (uu UInt64s) MarshalJSON() ([]byte, error)

Jump to

Keyboard shortcuts

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