(v reflect.Value)
| 256 | var superValueType = reflect.TypeFor[super.Value]() |
| 257 | |
| 258 | func (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 | |
| 274 | func (m *MarshalBSUPContext) encodeAny(v reflect.Value) (super.Type, error) { |
| 275 | if !v.IsValid() { |
no test coverage detected