MCPcopy Create free account
hub / github.com/cockroachdb/swiss / GoString

Method GoString

map.go:704–713  ·  view source on GitHub ↗

GoString implements the fmt.GoStringer interface which is used when formatting using the "%#v" format specifier.

()

Source from the content-addressed store, hash-verified

702// GoString implements the fmt.GoStringer interface which is used when
703// formatting using the "%#v" format specifier.
704func (m *Map[K, V]) GoString() string {
705 var buf strings.Builder
706 fmt.Fprintf(&buf, "used=%d global-depth=%d bucket-count=%d\n", m.used, m.globalDepth(), m.bucketCount())
707 m.buckets(0, func(b *bucket[K, V]) bool {
708 fmt.Fprintf(&buf, "bucket %d (%p): local-depth=%d\n", b.index, b, b.localDepth)
709 b.goFormat(&buf)
710 return true
711 })
712 return buf.String()
713}
714
715// Len returns the number of entries in the map.
716func (m *Map[K, V]) Len() int {

Callers

nothing calls this directly

Calls 5

globalDepthMethod · 0.95
bucketCountMethod · 0.95
bucketsMethod · 0.95
goFormatMethod · 0.95
StringMethod · 0.45

Tested by

no test coverage detected