MCPcopy
hub / github.com/segmentio/kafka-go / stringEncodeFuncOf

Function stringEncodeFuncOf

protocol/encode.go:407–420  ·  view source on GitHub ↗
(flexible bool, tag structTag)

Source from the content-addressed store, hash-verified

405}
406
407func stringEncodeFuncOf(flexible bool, tag structTag) encodeFunc {
408 switch {
409 case flexible && tag.Nullable:
410 // In flexible messages, all strings are compact
411 return (*encoder).encodeCompactNullString
412 case flexible:
413 // In flexible messages, all strings are compact
414 return (*encoder).encodeCompactString
415 case tag.Nullable:
416 return (*encoder).encodeNullString
417 default:
418 return (*encoder).encodeString
419 }
420}
421
422func bytesEncodeFuncOf(flexible bool, tag structTag) encodeFunc {
423 switch {

Callers 1

encodeFuncOfFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected