MCPcopy Create free account
hub / github.com/LagrangeDev/LagrangeGo / String

Method String

utils/binary/reader.go:49–61  ·  view source on GitHub ↗

String means read all available data and return them as a string if r.reader got error, it will returns as err.Error()

()

Source from the content-addressed store, hash-verified

47//
48// if r.reader got error, it will returns as err.Error()
49func (r *Reader) String() string {
50 if r.reader != nil {
51 data, err := io.ReadAll(r.reader)
52 if err != nil {
53 return err.Error()
54 }
55 return utils.B2S(data)
56 }
57 s := string(r.buffer[r.pos:])
58 r.pos = 0
59 r.buffer = r.buffer[:0]
60 return s
61}
62
63// ReadAll means read all available data and return them
64//

Callers 3

GetSha1StatusFunction · 0.45
GetcallerFunction · 0.45
UInt32ToIPV4AddressFunction · 0.45

Calls 3

B2SFunction · 0.92
ReadAllMethod · 0.80
ErrorMethod · 0.65

Tested by

no test coverage detected