MCPcopy Create free account
hub / github.com/brimdata/super / encodeValue

Method encodeValue

sup/marshal.go:258–272  ·  view source on GitHub ↗
(v reflect.Value)

Source from the content-addressed store, hash-verified

256var superValueType = reflect.TypeFor[super.Value]()
257
258func (m *MarshalBSUPContext) encodeValue(v reflect.Value) (super.Type, error) {
259 typ, err := m.encodeAny(v)
260 if err != nil {
261 return nil, err
262 }
263 if _, ok := typ.(*super.TypeNamed); ok {
264 // We already have a named type.
265 return typ, nil
266 }
267 if !v.IsValid() {
268 // v.Type will panic.
269 return typ, nil
270 }
271 return m.lookupTypeNamed(v.Type(), typ)
272}
273
274func (m *MarshalBSUPContext) encodeAny(v reflect.Value) (super.Type, error) {
275 if !v.IsValid() {

Callers 7

MarshalValueMethod · 0.95
MarshalMethod · 0.95
MarshalCustomMethod · 0.95
encodeAnyMethod · 0.95
encodeMapMethod · 0.95
encodeRecordMethod · 0.95
encodeArrayMethod · 0.95

Calls 4

encodeAnyMethod · 0.95
lookupTypeNamedMethod · 0.95
IsValidMethod · 0.80
TypeMethod · 0.65

Tested by

no test coverage detected