MCPcopy Create free account
hub / github.com/cloudwego/netpoll / WriteString

Method WriteString

nocopy_linkbuffer.go:541–547  ·  view source on GitHub ↗

WriteString implements Writer.

(s string)

Source from the content-addressed store, hash-verified

539
540// WriteString implements Writer.
541func (b *UnsafeLinkBuffer) WriteString(s string) (n int, err error) {
542 if len(s) == 0 {
543 return
544 }
545 buf := unsafe.Slice(unsafe.StringData(s), len(s))
546 return b.WriteBinary(buf)
547}
548
549// WriteBinary implements Writer.
550func (b *UnsafeLinkBuffer) WriteBinary(p []byte) (n int, err error) {

Callers

nothing calls this directly

Calls 2

WriteBinaryMethod · 0.95
SliceMethod · 0.65

Tested by

no test coverage detected