MCPcopy
hub / github.com/grafana/tempo / GetStringSlice

Method GetStringSlice

pkg/traceql/enum_hints.go:95–105  ·  view source on GitHub ↗
(k string, allowUnsafe bool)

Source from the content-addressed store, hash-verified

93}
94
95func (h *Hints) GetStringSlice(k string, allowUnsafe bool) (v []string, ok bool) {
96 s, ok := h.Get(k, TypeString, allowUnsafe)
97 if !ok {
98 return
99 }
100
101 // currently the syntax for array values in hints is `with(hintname=v1,v2,v3)` once we have actual
102 // array syntax in the language, we use arrays here and change the syntax to `with(hintname=[v1,v2,v3])`
103 ss := strings.Split(s.EncodeToString(false), ",")
104 return ss, true
105}
106
107func (h *Hints) Get(k string, t StaticType, allowUnsafe bool) (v Static, ok bool) {
108 if h == nil {

Callers 1

parseInternalFunction · 0.80

Calls 2

GetMethod · 0.95
EncodeToStringMethod · 0.80

Tested by

no test coverage detected