widestFirstColumnValue calculates the width needed to fully display the image names and platforms.
(headers []imgColumn, images []topImage)
| 543 | |
| 544 | // widestFirstColumnValue calculates the width needed to fully display the image names and platforms. |
| 545 | func widestFirstColumnValue(headers []imgColumn, images []topImage) int { |
| 546 | width := len(headers[0].Title) |
| 547 | for _, img := range images { |
| 548 | names := img.Names |
| 549 | if len(names) == 0 { |
| 550 | names = []string{untaggedName} |
| 551 | } |
| 552 | for _, name := range names { |
| 553 | if len(name) > width { |
| 554 | width = len(name) |
| 555 | } |
| 556 | } |
| 557 | for _, sub := range img.Children { |
| 558 | pl := len(sub.Platform) + len("└─ ") |
| 559 | if pl > width { |
| 560 | width = pl |
| 561 | } |
| 562 | } |
| 563 | } |
| 564 | return width |
| 565 | } |
no outgoing calls
no test coverage detected
searching dependent graphs…