VolumeWrite writes formatted volumes using the Context
(ctx Context, volumes []volume.Volume)
| 45 | |
| 46 | // VolumeWrite writes formatted volumes using the Context |
| 47 | func VolumeWrite(ctx Context, volumes []volume.Volume) error { |
| 48 | render := func(format func(subContext SubContext) error) error { |
| 49 | for _, vol := range volumes { |
| 50 | if err := format(&volumeContext{v: vol}); err != nil { |
| 51 | return err |
| 52 | } |
| 53 | } |
| 54 | return nil |
| 55 | } |
| 56 | return ctx.Write(newVolumeContext(), render) |
| 57 | } |
| 58 | |
| 59 | type volumeContext struct { |
| 60 | HeaderContext |
searching dependent graphs…