(ctx string)
| 452 | } |
| 453 | |
| 454 | func (p *printer) wrapErrCheck(ctx string) { |
| 455 | p.print("\nif err != nil {") |
| 456 | if ctx != "" { |
| 457 | p.printf("\nerr = msgp.WrapError(err, %s)", ctx) |
| 458 | } else { |
| 459 | p.print("\nerr = msgp.WrapError(err)") |
| 460 | } |
| 461 | p.printf("\nreturn") |
| 462 | p.print("\n}") |
| 463 | } |
| 464 | |
| 465 | func (p *printer) resizeSlice(size string, s *Slice) { |
| 466 | p.printf("\nif cap(%[1]s) >= int(%[2]s) { %[1]s = (%[1]s)[:%[2]s] } else { %[1]s = make(%[3]s, %[2]s) }", s.Varname(), size, s.TypeName()) |
no test coverage detected