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

Method Write

go/fory/string.go:177–189  ·  view source on GitHub ↗
(ctx *WriteContext, refMode RefMode, writeType bool, hasGenerics bool, value reflect.Value)

Source from the content-addressed store, hash-verified

175type ptrToStringSerializer struct{}
176
177func (s ptrToStringSerializer) Write(ctx *WriteContext, refMode RefMode, writeType bool, hasGenerics bool, value reflect.Value) {
178 if refMode != RefModeNone {
179 if value.IsNil() {
180 ctx.buffer.WriteInt8(NullFlag)
181 return
182 }
183 ctx.buffer.WriteInt8(NotNullValueFlag)
184 }
185 if writeType {
186 ctx.buffer.WriteUint8(uint8(STRING))
187 }
188 s.WriteData(ctx, value)
189}
190
191func (s ptrToStringSerializer) WriteData(ctx *WriteContext, value reflect.Value) {
192 str := value.Interface().(*string)

Callers

nothing calls this directly

Calls 4

WriteDataMethod · 0.95
WriteUint8Method · 0.80
uint8Function · 0.50
WriteInt8Method · 0.45

Tested by

no test coverage detected