comm

package
v0.0.0-...-2df04ca Latest Latest
Warning

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

Go to latest
Published: Jun 6, 2021 License: BSD-4-Clause Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func JSONBytesEqual

func JSONBytesEqual(a, b []byte) (bool, error)

JSONBytesEqual compares the JSON in two byte slices.

func ListCompare

func ListCompare(subsetSlice interface{}, supersetSlice interface{}, match MatchComparator) interface{}

ListCompare compare two lists and returns the first non matching item of the subset first list argument or nil if All subset elements were matched In case the superset and subset have same length this corresponds to the equality condition (based on the match comparator)

func ListToMap

func ListToMap(slice interface{}, key string) map[string]interface{}

ListToMap converts a List into a Map by the provided key

func SliceInterfaceToSlice

func SliceInterfaceToSlice(slice interface{}) []interface{}

SliceInterfaceToSlice Convert a Slice interface to an actual explicit slide

func ToJSONString

func ToJSONString(e error) string

ToJSONString converts error string to json string

Types

type ErrorString

type ErrorString struct {
	S string
}

ErrorString is an error string

func (*ErrorString) Error

func (e *ErrorString) Error() string

Error returns the string of the error (wow!)

type MatchComparator

type MatchComparator func(l interface{}, r interface{}) bool

MatchComparator takes a left and right element and compare them. In case of matching true is returned, false otherwise

Jump to

Keyboard shortcuts

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