Size returns the container's size and virtual size (e.g. "2B (virtual 21.5MB)")
()
| 280 | |
| 281 | // Size returns the container's size and virtual size (e.g. "2B (virtual 21.5MB)") |
| 282 | func (c *ContainerContext) Size() string { |
| 283 | if c.FieldsUsed == nil { |
| 284 | c.FieldsUsed = map[string]any{} |
| 285 | } |
| 286 | c.FieldsUsed["Size"] = struct{}{} |
| 287 | srw := units.HumanSizeWithPrecision(float64(c.c.SizeRw), 3) |
| 288 | sv := units.HumanSizeWithPrecision(float64(c.c.SizeRootFs), 3) |
| 289 | |
| 290 | sf := srw |
| 291 | if c.c.SizeRootFs > 0 { |
| 292 | sf = fmt.Sprintf("%s (virtual %s)", srw, sv) |
| 293 | } |
| 294 | return sf |
| 295 | } |
nothing calls this directly
no outgoing calls
no test coverage detected