MCPcopy
hub / github.com/go-task/task / UniqueJoin

Function UniqueJoin

internal/slicesext/slicesext.go:8–20  ·  view source on GitHub ↗
(ss ...[]T)

Source from the content-addressed store, hash-verified

6)
7
8func UniqueJoin[T cmp.Ordered](ss ...[]T) []T {
9 var length int
10 for _, s := range ss {
11 length += len(s)
12 }
13 r := make([]T, length)
14 var i int
15 for _, s := range ss {
16 i += copy(r[i:], s)
17 }
18 slices.Sort(r)
19 return slices.Compact(r)
20}
21
22func Convert[T, U any](s []T, f func(T) U) []U {
23 // Create a new slice with the same length as the input slice

Callers 2

collectSourcesMethod · 0.92
runCommandMethod · 0.92

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…