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

Function takeFirstSlice

coderd/database/dbgen/dbgen.go:2121–2125  ·  view source on GitHub ↗

takeFirstSlice implements takeFirst for []any. []any is not a comparable type.

(values ...[]T)

Source from the content-addressed store, hash-verified

2119// takeFirstSlice implements takeFirst for []any.
2120// []any is not a comparable type.
2121func takeFirstSlice[T any](values ...[]T) []T {
2122 return takeFirstF(values, func(v []T) bool {
2123 return len(v) != 0
2124 })
2125}
2126
2127func takeFirstMap[T, E comparable](values ...map[T]E) map[T]E {
2128 return takeFirstF(values, func(v map[T]E) bool {

Callers 15

AuditLogFunction · 0.85
ChatModelConfigFunction · 0.85
MCPServerConfigFunction · 0.85
APIKeyFunction · 0.85
WorkspaceAgentFunction · 0.85
UserFunction · 0.85
OrganizationMemberFunction · 0.85
NotificationInboxFunction · 0.85
ProvisionerDaemonFunction · 0.85
ProvisionerJobFunction · 0.85
FileFunction · 0.85
TemplateVersionParameterFunction · 0.85

Calls 1

takeFirstFFunction · 0.70

Tested by

no test coverage detected