diff options
| author | Jeff Carr <[email protected]> | 2024-11-01 00:41:34 -0500 |
|---|---|---|
| committer | Jeff Carr <[email protected]> | 2024-11-01 00:41:34 -0500 |
| commit | 706dbbc53328dbfe74f70aee38765551d6a836d0 (patch) | |
| tree | eb8655efdf8d6423546349686c54fc03c806e105 /add.go | |
| parent | b6f5594fe6b92b5b3a76e22ba3823c9ac8e00cd2 (diff) | |
pretty output for humans d.SprintHeader()
Signed-off-by: Jeff Carr <[email protected]>
Diffstat (limited to 'add.go')
| -rw-r--r-- | add.go | 33 |
1 files changed, 1 insertions, 32 deletions
@@ -22,11 +22,6 @@ func (x *Hypervisor) SetMemoryGB(gb int) { x.Memory = int64(gb * 1024 * 1024 * 1024) } -func (x *Hypervisor) GetMemoryPrintable() string { - i := x.Memory / (1024 * 1024 * 1024) - return fmt.Sprintf("%d GB", i) -} - func (all *Droplets) oldFindDroplet(name string) *Droplet { for _, d := range all.Droplets { if d.Hostname == name { @@ -111,7 +106,7 @@ func (c *NewCluster) AddDropletLocal(name string, hypername string) *Droplet { d := &Droplet{ Hostname: name, } - d.LocalOnly = hypername + d.LocalOnly = "yes on: " + hypername d.Current = new(Current) d.Current.Hypervisor = hypername d.StartState = DropletState_OFF @@ -121,32 +116,6 @@ func (c *NewCluster) AddDropletLocal(name string, hypername string) *Droplet { return d } -// This isn't for the marketing department -// so this isn't going to use 'MiB' and 'GiB' -func HumanFormatBytes(b int64) string { - if b < 2000 { - return fmt.Sprintf("%d B", b) - } - - kb := int(b / 1024) - if kb < 2000 { - return fmt.Sprintf("%d KB", kb) - } - - mb := int(b / (1024 * 1024)) - if mb < 2000 { - return fmt.Sprintf("%d MB", mb) - } - - gb := int(b / (1024 * 1024 * 1024)) - if gb < 2000 { - return fmt.Sprintf("%d GB", gb) - } - - tb := int(b / (1024 * 1024 * 1024 * 1024)) - return fmt.Sprintf("%d TB", tb) -} - func (c *NewCluster) BlankFields() { loop := c.DropletsAll() // get the list of droplets for loop.Scan() { |
