summaryrefslogtreecommitdiff
path: root/config.go
diff options
context:
space:
mode:
authorJeff Carr <[email protected]>2024-12-01 18:41:00 -0600
committerJeff Carr <[email protected]>2024-12-01 18:41:00 -0600
commitafd0bd642841f4dee9ca29c4913a26319aa28dd9 (patch)
tree31d55b1e4b24fb26b2927ae7f1d86364345d90dc /config.go
parent5b883de7b99fc15d92646a7c965fdf28f1946343 (diff)
switched to autogenpbv0.2.10
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