Fix cyclomatic complexity of two formatters
@@ -65,7 +65,9 @@ reclaimable: {{.Reclaimable}}
}
func (ctx *DiskUsageContext) Write() (err error) {
- if !ctx.Verbose {
+ if ctx.Verbose {
+ return ctx.verboseWrite()
+ }
ctx.buffer = bytes.NewBufferString("")
ctx.preFormat()
@@ -108,6 +110,7 @@ func (ctx *DiskUsageContext) Write() (err error) {
return err
}
+func (ctx *DiskUsageContext) verboseWrite() (err error) {
// First images
tmpl, err := ctx.startSubsection(defaultDiskUsageImageTableFormat)
if err != nil {
