MCPcopy Create free account
hub / github.com/apache/fory / WriteStringSlice

Method WriteStringSlice

go/fory/writer.go:440–452  ·  view source on GitHub ↗

WriteStringSlice writes []string with ref/type info using LIST protocol. hasGenerics indicates whether element type is known from TypeDef/generics (struct field context).

(value []string, refMode RefMode, writeTypeInfo bool, hasGenerics bool)

Source from the content-addressed store, hash-verified

438// WriteStringSlice writes []string with ref/type info using LIST protocol.
439// hasGenerics indicates whether element type is known from TypeDef/generics (struct field context).
440func (c *WriteContext) WriteStringSlice(value []string, refMode RefMode, writeTypeInfo bool, hasGenerics bool) {
441 if refMode != RefModeNone {
442 if value == nil {
443 c.buffer.WriteInt8(NullFlag)
444 return
445 }
446 c.buffer.WriteInt8(NotNullValueFlag)
447 }
448 if writeTypeInfo {
449 c.WriteTypeId(LIST)
450 }
451 WriteStringSlice(c.buffer, value, hasGenerics)
452}
453
454// WriteStringStringMap writes map[string]string with ref/type info
455func (c *WriteContext) WriteStringStringMap(value map[string]string, refMode RefMode, writeTypeInfo bool) {

Callers 1

writeRemainingFieldMethod · 0.80

Calls 3

WriteTypeIdMethod · 0.95
WriteStringSliceFunction · 0.85
WriteInt8Method · 0.45

Tested by

no test coverage detected