MCPcopy Create free account
hub / github.com/cockroachdb/cockroachdb-parser / formatSpan

Function formatSpan

pkg/sql/inverted/expression.go:156–173  ·  view source on GitHub ↗
(span Span, redactable bool)

Source from the content-addressed store, hash-verified

154}
155
156func formatSpan(span Span, redactable bool) string {
157 spanEndOpenOrClosed := ')'
158 vals, _ := encoding.PrettyPrintValuesWithTypes(nil, span.Start)
159 start := strings.Join(vals, "/")
160 var end string
161 if span.IsSingleVal() {
162 end = start
163 spanEndOpenOrClosed = ']'
164 } else {
165 vals, _ := encoding.PrettyPrintValuesWithTypes(nil, span.End)
166 end = strings.Join(vals, "/")
167 }
168 output := fmt.Sprintf("[%s, %s%c", start, end, spanEndOpenOrClosed)
169 if redactable {
170 output = string(redact.Sprintf("%s", encoding.Unsafe(output)))
171 }
172 return output
173}
174
175// Len implements sort.Interface.
176func (is Spans) Len() int { return len(is) }

Callers 1

FormatMethod · 0.85

Calls 3

UnsafeFunction · 0.92
IsSingleValMethod · 0.80

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…