summaryrefslogtreecommitdiff
path: root/config.go
diff options
context:
space:
mode:
Diffstat (limited to 'config.go')
-rw-r--r--config.go17
1 files changed, 6 insertions, 11 deletions
diff --git a/config.go b/config.go
index 0274fcf..082a2ab 100644
--- a/config.go
+++ b/config.go
@@ -25,12 +25,10 @@ func (c *Cluster) ConfigSave() error {
// make a new droplets struct
var dcopy *Droplets
dcopy = new(Droplets)
- loop := c.DropletsAll() // get the list of droplets
+ loop := c.d.All() // get the list of droplets
for loop.Scan() {
- d := loop.Droplet()
- var newd Droplet
- newd = *d
- dcopy.Droplets = append(dcopy.Droplets, &newd)
+ d := loop.Next()
+ dcopy.Droplets = append(dcopy.Droplets, d)
}
// delete all the Current data so it's not put in the config file
for _, drop := range dcopy.Droplets {
@@ -184,13 +182,10 @@ func (c *Cluster) configWriteDroplets() error {
fmt.Println("open config file :", err)
return err
}
- loop := c.DropletsAll() // get the list of droplets
+ loop := c.d.All() // get the list of droplets
for loop.Scan() {
- d := loop.Droplet()
- var newd Droplet
- newd = *d
- newd.Current = nil
- text := prototext.Format(&newd)
+ d := loop.Next()
+ text := prototext.Format(d)
fmt.Fprintln(cfgfile, text)
}
return nil