()
| 349 | } |
| 350 | |
| 351 | func timeDecoder() MapperFunc { |
| 352 | return func(ctx *DecodeContext, target reflect.Value) error { |
| 353 | format := time.RFC3339 |
| 354 | if ctx.Value.Format != "" { |
| 355 | format = ctx.Value.Format |
| 356 | } |
| 357 | var value string |
| 358 | if err := ctx.Scan.PopValueInto("time", &value); err != nil { |
| 359 | return err |
| 360 | } |
| 361 | t, err := time.Parse(format, value) |
| 362 | if err != nil { |
| 363 | return err |
| 364 | } |
| 365 | target.Set(reflect.ValueOf(t)) |
| 366 | return nil |
| 367 | } |
| 368 | } |
| 369 | |
| 370 | func intDecoder(bits int) MapperFunc { //nolint: dupl |
| 371 | return func(ctx *DecodeContext, target reflect.Value) error { |
no test coverage detected