MCPcopy Create free account
hub / github.com/cloudwego/dynamicgo / ReadString

Method ReadString

proto/binary/binary.go:960–974  ·  view source on GitHub ↗

ReadString

(copy bool)

Source from the content-addressed store, hash-verified

958
959// ReadString
960func (p *BinaryProtocol) ReadString(copy bool) (value string, err error) {
961 bytes, n, all := protowire.BinaryDecoder{}.DecodeBytes((p.Buf)[p.Read:])
962 if n < 0 {
963 return "", errDecodeField
964 }
965 if copy {
966 value = string(bytes)
967 } else {
968 v := (*rt.GoString)(unsafe.Pointer(&value))
969 v.Ptr = rt.IndexPtr(*(*unsafe.Pointer)(unsafe.Pointer(&p.Buf)), byteTypeSize, p.Read+n)
970 v.Len = int(all - n)
971 }
972 _, err = p.next(all)
973 return
974}
975
976// ReadEnum
977func (p *BinaryProtocol) ReadEnum() (proto.EnumNumber, error) {

Callers 5

ReadBaseTypeWithDescMethod · 0.95
searchStrKeyFunction · 0.45
findDeleteChildMethod · 0.45
scanChildrenMethod · 0.45
NextStrMethod · 0.45

Calls 3

nextMethod · 0.95
IndexPtrFunction · 0.92
DecodeBytesMethod · 0.45

Tested by

no test coverage detected