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

Function Omit

coderd/util/slice/slice.go:47–56  ·  view source on GitHub ↗

Omit creates a new slice with the arguments omitted from the list.

(a []T, omits ...T)

Source from the content-addressed store, hash-verified

45
46// Omit creates a new slice with the arguments omitted from the list.
47func Omit[T comparable](a []T, omits ...T) []T {
48 tmp := make([]T, 0, len(a))
49 for _, v := range a {
50 if Contains(omits, v) {
51 continue
52 }
53 tmp = append(tmp, v)
54 }
55 return tmp
56}
57
58// SameElements returns true if the 2 lists have the same elements in any
59// order.

Callers 5

ReloadBuiltinRolesFunction · 0.92
TestAuthorizeDomainFunction · 0.92
TestAuthorizeLevelsFunction · 0.92
WorkspaceRoleActionsFunction · 0.92
TestOmitFunction · 0.92

Calls 1

ContainsFunction · 0.85

Tested by 3

TestAuthorizeDomainFunction · 0.74
TestAuthorizeLevelsFunction · 0.74
TestOmitFunction · 0.74