nolint
(d *Decoder, typ reflect.Type, cls *ClassInfo)
| 109 | |
| 110 | // nolint |
| 111 | func (JavaSqlTimeSerializer) DecObject(d *Decoder, typ reflect.Type, cls *ClassInfo) (interface{}, error) { |
| 112 | if typ.Kind() != reflect.Struct { |
| 113 | return nil, perrors.Errorf("wrong type expect Struct but get:%s", typ.String()) |
| 114 | } |
| 115 | |
| 116 | vRef := reflect.New(typ) |
| 117 | // add pointer ref so that ref the same object |
| 118 | d.appendRefs(vRef.Interface()) |
| 119 | |
| 120 | tag, err := d.ReadByte() |
| 121 | if perrors.Is(err, io.EOF) { |
| 122 | return nil, err |
| 123 | } |
| 124 | date, err := d.decDate(int32(tag)) |
| 125 | if err != nil { |
| 126 | return nil, perrors.WithStack(err) |
| 127 | } |
| 128 | sqlTime := vRef.Interface() |
| 129 | |
| 130 | result, ok := sqlTime.(java_sql_time.JavaSqlTime) |
| 131 | if !ok { |
| 132 | panic("result type is not sql time, please check the whether the conversion is ok") |
| 133 | } |
| 134 | result.SetTime(date) |
| 135 | return result, nil |
| 136 | } |
nothing calls this directly
no test coverage detected