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

Method Write

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

Source from the content-addressed store, hash-verified

192}
193
194func (s *optionalSerializer) Write(ctx *WriteContext, refMode RefMode, writeType bool, hasGenerics bool, value reflect.Value) {
195 if !s.has(value) {
196 s.writeNull(ctx, refMode, writeType)
197 return
198 }
199 valueField := s.valueField(value)
200 s.writeValue(ctx, refMode, writeType, valueField)
201}
202
203func (s *optionalSerializer) writeNull(ctx *WriteContext, refMode RefMode, writeType bool) {
204 switch refMode {

Callers

nothing calls this directly

Calls 4

hasMethod · 0.95
writeNullMethod · 0.95
valueFieldMethod · 0.95
writeValueMethod · 0.95

Tested by

no test coverage detected