MCPcopy Create free account
hub / github.com/golang/groupcache / SetString

Method SetString

sinks.go:311–322  ·  view source on GitHub ↗
(v string)

Source from the content-addressed store, hash-verified

309}
310
311func (s *truncBytesSink) SetString(v string) error {
312 if s.dst == nil {
313 return errors.New("nil TruncatingByteSliceSink *[]byte dst")
314 }
315 n := copy(*s.dst, v)
316 if n < len(*s.dst) {
317 *s.dst = (*s.dst)[:n]
318 }
319 s.v.b = nil
320 s.v.s = v
321 return nil
322}

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected