MCPcopy Create free account
hub / github.com/go-git/go-git / Encode

Method Encode

plumbing/format/pktline/encoder.go:56–64  ·  view source on GitHub ↗

Encode encodes a pkt-line with the payload specified and write it to the output stream. If several payloads are specified, each of them will get streamed in their own pkt-lines.

(payloads ...[]byte)

Source from the content-addressed store, hash-verified

54// the output stream. If several payloads are specified, each of them
55// will get streamed in their own pkt-lines.
56func (e *Encoder) Encode(payloads ...[]byte) error {
57 for _, p := range payloads {
58 if err := e.encodeLine(p); err != nil {
59 return err
60 }
61 }
62
63 return nil
64}
65
66func (e *Encoder) encodeLine(p []byte) error {
67 if len(p) > MaxPayloadSize {

Callers 3

EncodeStringMethod · 0.95
TestEncodeMethod · 0.95

Calls 1

encodeLineMethod · 0.95

Tested by 2

TestEncodeMethod · 0.76