collections

package
v0.8.0 Latest Latest
Warning

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

Go to latest
Published: Sep 23, 2026 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Contains

func Contains[T comparable](slice []T, item T) bool

func ItemExists

func ItemExists[T comparable](slice []T, item T) (exists bool, index int)

func SlicesEqual

func SlicesEqual[T comparable](slice1, slice2 []T) bool

SlicesEqual checks if two slices contain the same elements (order doesn't matter) This is essentially set equality for slices

func StructsEqual

func StructsEqual(a, b interface{}) bool

func SubtractListBFromListA

func SubtractListBFromListA[T any](listA, listB []T) []T

SubtractListBFromListA returns the items in listA that are not in listB. It uses reflect.DeepEqual rather than == so elements may hold uncomparable values (e.g. Alexa ContextProperty.Value can be a map such as a light's color spectrumHsv); == on such a value panics at runtime with "comparing uncomparable type map[string]interface {}".

Types

This section is empty.

Jump to

Keyboard shortcuts

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