MCPcopy Create free account
hub / github.com/goadesign/goa / ToExpressionSet

Function ToExpressionSet

eval/expression.go:103–117  ·  view source on GitHub ↗

ToExpressionSet is a convenience function that accepts a slice of expressions and builds the corresponding ExpressionSet.

(slice any)

Source from the content-addressed store, hash-verified

101// ToExpressionSet is a convenience function that accepts a slice of expressions
102// and builds the corresponding ExpressionSet.
103func ToExpressionSet(slice any) ExpressionSet {
104 if slice == nil {
105 return nil
106 }
107 s := reflect.ValueOf(slice)
108 if s.Kind() != reflect.Slice {
109 panic("ToExpressionSet() given a non-slice type") // bug
110 }
111 ret := make(ExpressionSet, s.Len())
112 for i := 0; i < s.Len(); i++ {
113 ret[i] = s.Index(i).Interface().(Expression)
114 }
115
116 return ret
117}

Callers 2

WalkSetsMethod · 0.92
TestToExpressionSetFunction · 0.85

Calls 1

KindMethod · 0.65

Tested by 1

TestToExpressionSetFunction · 0.68