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

Function List

coderd/util/slice/slice.go:10–12  ·  view source on GitHub ↗

List is a helper function to reduce boilerplate when converting slices of database types to slices of codersdk types. Only works if the function takes a single argument.

(list []F, convert func(F) T)

Source from the content-addressed store, hash-verified

8// database types to slices of codersdk types.
9// Only works if the function takes a single argument.
10func List[F any, T any](list []F, convert func(F) T) []T {
11 return ListLazy(convert)(list)
12}
13
14// ListLazy returns the converter function for a list, but does not eval
15// the input. Helpful for combining the Map and the List functions.

Callers 15

provisionerDaemonsMethod · 0.92
organizationsByUserMethod · 0.92
convertAPIKeyFunction · 0.92
provisionerJobsMethod · 0.92
TestListMembersFunction · 0.92
organizationsMethod · 0.92
SyncGroupsMethod · 0.92
SyncOrganizationsMethod · 0.92
TestApplyGroupDifferenceFunction · 0.92

Calls 1

ListLazyFunction · 0.85

Tested by 15

TestListMembersFunction · 0.74
TestApplyGroupDifferenceFunction · 0.74
AssertMethod · 0.74
TestSyncOrganizationsFunction · 0.74
TestWorkspaceQuotasFunction · 0.74
TestReadCustomRolesFunction · 0.74
TestGroupRemovalTriggerFunction · 0.74
TestInsertCustomRolesFunction · 0.74
TestUserMethod · 0.74
TestEnterpriseMembersFunction · 0.74
AssertOrganizationsMethod · 0.74
TestGroupFunction · 0.74