File tree Expand file tree Collapse file tree 1 file changed +14
-0
lines changed Expand file tree Collapse file tree 1 file changed +14
-0
lines changed Original file line number Diff line number Diff line change @@ -142,11 +142,25 @@ func NewValueStruct(v *Struct) *Value {
142142 return & Value {Kind : & Value_StructValue {StructValue : v }}
143143}
144144
145+ // Constructs a new struct Value from the provided field map.
146+ func NewValueFromFields (fields map [string ]* Value ) * Value {
147+ return & Value {Kind : & Value_StructValue {StructValue : & Struct {
148+ Fields : fields ,
149+ }}}
150+ }
151+
145152// Constructs a new list Value.
146153func NewValueList (v * ListValue ) * Value {
147154 return & Value {Kind : & Value_ListValue {ListValue : v }}
148155}
149156
157+ // Constructs a new list Value from the provided elements.
158+ func NewValueFromList (values ... * Value ) * Value {
159+ return & Value {Kind : & Value_ListValue {ListValue : & ListValue {
160+ Values : values ,
161+ }}}
162+ }
163+
150164// Constructs a ListValue from a general-purpose Go slice.
151165// The slice elements are converted using NewValue().
152166func NewListValue (v []interface {}) (* ListValue , error ) {
You can’t perform that action at this time.
0 commit comments