~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/filesystemlistformatters.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
// formatFilesystemListTabular writes a tabular summary of filesystem instances.
18
 
func formatFilesystemListTabular(writer io.Writer, value interface{}) error {
19
 
        infos, ok := value.(map[string]FilesystemInfo)
20
 
        if !ok {
21
 
                return errors.Errorf("expected value of type %T, got %T", infos, value)
22
 
        }
23
 
        formatFilesystemListTabularTyped(writer, infos)
24
 
        return nil
25
 
}
26
 
 
27
 
func formatFilesystemListTabularTyped(writer io.Writer, infos map[string]FilesystemInfo) {
 
17
func formatFilesystemListTabular(writer io.Writer, infos map[string]FilesystemInfo) error {
28
18
        tw := output.TabWriter(writer)
29
19
 
30
20
        print := func(values ...string) {
76
66
                )
77
67
        }
78
68
 
79
 
        tw.Flush()
 
69
        return tw.Flush()
80
70
}
81
71
 
82
72
type filesystemAttachmentInfo struct {