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

Method EncodeString

plumbing/format/pktline/encoder.go:109–117  ·  view source on GitHub ↗

EncodeString works similarly as Encode but payloads are specified as strings.

(payloads ...string)

Source from the content-addressed store, hash-verified

107
108// EncodeString works similarly as Encode but payloads are specified as strings.
109func (e *Encoder) EncodeString(payloads ...string) error {
110 for _, p := range payloads {
111 if err := e.Encode([]byte(p)); err != nil {
112 return err
113 }
114 }
115
116 return nil
117}
118
119// Encodef encodes a single pkt-line with the payload formatted as
120// the format specifier. The rest of the arguments will be used in

Callers 15

testMethod · 0.95
TestWithPackfileMethod · 0.95
testDecodeOKMethod · 0.95
pktlinesFunction · 0.95
toPktLinesFunction · 0.95
TestEmptyPrefixFlushMethod · 0.95
testDecodeOKMethod · 0.95
testDecodeOKMethod · 0.95
EncodefMethod · 0.95
TestScanAndPayloadMethod · 0.95
TestSkipMethod · 0.95

Calls 1

EncodeMethod · 0.95

Tested by 14

testMethod · 0.76
TestWithPackfileMethod · 0.76
testDecodeOKMethod · 0.76
pktlinesFunction · 0.76
toPktLinesFunction · 0.76
TestEmptyPrefixFlushMethod · 0.76
testDecodeOKMethod · 0.76
testDecodeOKMethod · 0.76
TestScanAndPayloadMethod · 0.76
TestSkipMethod · 0.76
TestEOFMethod · 0.76
sectionsExampleFunction · 0.76