(indent int, open, close string, inner super.Type, val super.Value, known bool)
| 447 | } |
| 448 | |
| 449 | func (f *Formatter) formatVector(indent int, open, close string, inner super.Type, val super.Value, known bool) bool { |
| 450 | f.build(open) |
| 451 | n, err := val.ContainerLength() |
| 452 | if err != nil { |
| 453 | panic(err) |
| 454 | } |
| 455 | if n == 0 { |
| 456 | f.build(close) |
| 457 | return true |
| 458 | } |
| 459 | indent += f.tab |
| 460 | sep := f.newline |
| 461 | it := val.ContainerIter() |
| 462 | elems := newElemBuilder(inner) |
| 463 | for !it.Done() { |
| 464 | f.build(sep) |
| 465 | f.indent(indent, "") |
| 466 | typ, b := elems.add(it.Next()) |
| 467 | f.formatValue(indent, typ, b, known, true) |
| 468 | sep = "," + f.newline |
| 469 | } |
| 470 | f.build(f.newline) |
| 471 | f.indent(indent-f.tab, close) |
| 472 | if elems.needsDecoration() { |
| 473 | // If we haven't seen all the types in the union, print the decorator |
| 474 | // so the fullness of the union is persevered. |
| 475 | f.decorate(val.Type(), true) |
| 476 | } |
| 477 | return false |
| 478 | } |
| 479 | |
| 480 | type elemHelper struct { |
| 481 | typ super.Type |
no test coverage detected