MCPcopy Index your code
hub / github.com/coder/coder / regoSlice

Function regoSlice

coderd/rbac/astvalue.go:242–248  ·  view source on GitHub ↗

regoSlice returns the ast.Array representation of the slice. The slice must contain only types that implement the regoValue interface.

(slice []T)

Source from the content-addressed store, hash-verified

240// regoSlice returns the ast.Array representation of the slice.
241// The slice must contain only types that implement the regoValue interface.
242func 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
250func regoSliceString[T ~string](slice ...T) *ast.Array {
251 terms := make([]*ast.Term, len(slice))

Callers 2

regoValueMethod · 0.85
regoValueMethod · 0.85

Calls 1

regoValueMethod · 0.65

Tested by

no test coverage detected