diff options
Diffstat (limited to 'config.go')
| -rw-r--r-- | config.go | 11 |
1 files changed, 11 insertions, 0 deletions
@@ -23,9 +23,18 @@ func (c *Cluster) ConfigSave() error { return err } + // make a new droplets struct var d *Droplets d = new(Droplets) d.Droplets = c.Droplets + // copy all the records over to the new struct + for _, drop := range c.Droplets { + d.Droplets = append(d.Droplets, drop) + } + // delete all the Current data so it's not put in the config file + for _, drop := range d.Droplets { + drop.Current = nil + } if err := ConfigWriteJSON(d, "droplets.json"); err != nil { fmt.Println("droplets.json write failed") return err @@ -139,6 +148,8 @@ func (c *Cluster) ConfigLoad() error { e = new(Events) if c.E == nil { + // this seems to panic on nil. something is wrong about doing this + // does it not stay allocated after this function ends? c.E = new(Events) } if err := e.loadEvents(); err != nil { |
