MCPcopy Index your code
hub / github.com/jackc/pgx / encodeTextArrayDimensions

Function encodeTextArrayDimensions

pgtype/array.go:344–365  ·  view source on GitHub ↗
(buf []byte, dimensions []ArrayDimension)

Source from the content-addressed store, hash-verified

342}
343
344func encodeTextArrayDimensions(buf []byte, dimensions []ArrayDimension) []byte {
345 var customDimensions bool
346 for _, dim := range dimensions {
347 if dim.LowerBound != 1 {
348 customDimensions = true
349 }
350 }
351
352 if !customDimensions {
353 return buf
354 }
355
356 for _, dim := range dimensions {
357 buf = append(buf, '[')
358 buf = append(buf, strconv.FormatInt(int64(dim.LowerBound), 10)...)
359 buf = append(buf, ':')
360 buf = append(buf, strconv.FormatInt(int64(dim.LowerBound+dim.Length-1), 10)...)
361 buf = append(buf, ']')
362 }
363
364 return append(buf, '=')
365}
366
367var quoteArrayReplacer = strings.NewReplacer(`\`, `\\`, `"`, `\"`)
368

Callers 1

EncodeMethod · 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…