regoSlice returns the ast.Array representation of the slice. The slice must contain only types that implement the regoValue interface.
(slice []T)
| 240 | // regoSlice returns the ast.Array representation of the slice. |
| 241 | // The slice must contain only types that implement the regoValue interface. |
| 242 | func regoSlice[T regoValue](slice []T) *ast.Array { |
| 243 | terms := make([]*ast.Term, len(slice)) |
| 244 | for i, v := range slice { |
| 245 | terms[i] = ast.NewTerm(v.regoValue()) |
| 246 | } |
| 247 | return ast.NewArray(terms...) |
| 248 | } |
| 249 | |
| 250 | func regoSliceString[T ~string](slice ...T) *ast.Array { |
| 251 | terms := make([]*ast.Term, len(slice)) |