MCPcopy Create free account
hub / github.com/cortexproject/cortex / FromLabelAdaptersToLabelsWithCopy

Function FromLabelAdaptersToLabelsWithCopy

pkg/cortexpb/compat.go:69–71  ·  view source on GitHub ↗

FromLabelAdaptersToLabelsWithCopy converts []LabelAdapter to labels.Labels. Do NOT use unsafe to convert between data types because this function may get in input labels whose data structure is reused.

(input []LabelAdapter)

Source from the content-addressed store, hash-verified

67// Do NOT use unsafe to convert between data types because this function may
68// get in input labels whose data structure is reused.
69func FromLabelAdaptersToLabelsWithCopy(input []LabelAdapter) labels.Labels {
70 return CopyLabels(input)
71}
72
73// Efficiently copies labels input slice. To be used in cases where input slice
74// can be reused, but long-term copy is needed.

Calls 1

CopyLabelsFunction · 0.85