Skip to main content

MakeLiteralForCollection

Converts a slice of interface{} values into a core.Literal representing a collection of literals. It iterates through the input slice, converting each element into a core.Literal, and then encapsulates these literals within a core.LiteralCollection.

def MakeLiteralForCollection(
v: []interface{}
) - > *core.Literal, error

Converts a slice of arbitrary Go interface values into a single core.Literal representing a collection of literals. This function is used to create a literal representation of a list or array of values, where each element in the input slice is individually converted into a core.Literal.

Parameters

NameTypeDescription
v[]interface{}The slice of arbitrary Go interface values to be converted into a collection of literals.

Returns

TypeDescription
*core.Literal, errorA pointer to a core.Literal representing the collection, or an error if any of the individual values cannot be converted into a literal.