~juju-qa/ubuntu/xenial/juju/2.0-rc2

« back to all changes in this revision

Viewing changes to src/github.com/juju/juju/cmd/juju/storage/volumelistformatters.go

  • Committer: Nicholas Skaggs
  • Date: 2016-09-30 14:39:30 UTC
  • mfrom: (1.8.1)
  • Revision ID: nicholas.skaggs@canonical.com-20160930143930-vwwhrefh6ftckccy
import upstream

Show diffs side-by-side

added added

removed removed

Lines of Context:
10
10
        "strings"
11
11
 
12
12
        "github.com/dustin/go-humanize"
13
 
        "github.com/juju/errors"
14
13
        "github.com/juju/juju/cmd/output"
15
14
)
16
15
 
17
16
// formatVolumeListTabular returns a tabular summary of volume instances.
18
 
func formatVolumeListTabular(writer io.Writer, value interface{}) error {
19
 
        infos, ok := value.(map[string]VolumeInfo)
20
 
        if !ok {
21
 
                return errors.Errorf("expected value of type %T, got %T", infos, value)
22
 
        }
23
 
        formatVolumeListTabularTyped(writer, infos)
24
 
        return nil
25
 
}
26
 
 
27
 
func formatVolumeListTabularTyped(writer io.Writer, infos map[string]VolumeInfo) {
 
17
func formatVolumeListTabular(writer io.Writer, infos map[string]VolumeInfo) error {
28
18
        tw := output.TabWriter(writer)
29
19
 
30
20
        print := func(values ...string) {
76
66
                )
77
67
        }
78
68
 
79
 
        tw.Flush()
80
 
        return
 
69
        return tw.Flush()
81
70
}
82
71
 
83
72
type volumeAttachmentInfo struct {