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

Function Slice

internal/deepcopy/deepcopy.go:22–35  ·  view source on GitHub ↗
(orig []T)

Source from the content-addressed store, hash-verified

20}
21
22func Slice[T any](orig []T) []T {
23 if orig == nil {
24 return nil
25 }
26 c := make([]T, len(orig))
27 for i, v := range orig {
28 if copyable, ok := any(v).(Copier[T]); ok {
29 c[i] = copyable.DeepCopy()
30 } else {
31 c[i] = v
32 }
33 }
34 return c
35}
36
37func Map[K comparable, V any](orig map[K]V) map[K]V {
38 if orig == nil {

Callers 7

DeepCopyMethod · 0.92
DeepCopyMethod · 0.92
DeepCopyMethod · 0.92
DeepCopyMethod · 0.92
DeepCopyMethod · 0.92
DeepCopyMethod · 0.92
DeepCopyMethod · 0.92

Calls 1

DeepCopyMethod · 0.65

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…