MCPcopy Create free account
hub / github.com/imroc/req / cloneSlice

Function cloneSlice

req.go:87–94  ·  view source on GitHub ↗
(s []T)

Source from the content-addressed store, hash-verified

85type DownloadCallback func(info DownloadInfo)
86
87func cloneSlice[T any](s []T) []T {
88 if len(s) == 0 {
89 return nil
90 }
91 ss := make([]T, len(s))
92 copy(ss, s)
93 return ss
94}
95
96func cloneUrlValues(v url.Values) url.Values {
97 if v == nil {

Callers 2

CloneMethod · 0.85
CloneMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…