writeUpdateState writes update state file.
(us *updateState)
| 54 | |
| 55 | // writeUpdateState writes update state file. |
| 56 | func (c *App) writeUpdateState(us *updateState) error { |
| 57 | var buf bytes.Buffer |
| 58 | |
| 59 | if err := json.NewEncoder(&buf).Encode(us); err != nil { |
| 60 | return errors.Wrap(err, "unable to marshal JSON") |
| 61 | } |
| 62 | |
| 63 | return errors.Wrap(atomicfile.Write(c.updateStateFilename(), &buf), "error writing update state") |
| 64 | } |
| 65 | |
| 66 | func (c *App) removeUpdateState() { |
| 67 | os.Remove(c.updateStateFilename()) //nolint:errcheck |
no test coverage detected