MCPcopy
hub / github.com/kopia/kopia / writeUpdateState

Method writeUpdateState

cli/update_check.go:56–64  ·  view source on GitHub ↗

writeUpdateState writes update state file.

(us *updateState)

Source from the content-addressed store, hash-verified

54
55// writeUpdateState writes update state file.
56func (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
66func (c *App) removeUpdateState() {
67 os.Remove(c.updateStateFilename()) //nolint:errcheck

Callers 3

maybeCheckForUpdatesMethod · 0.95
maybeCheckGithubMethod · 0.95

Calls 2

updateStateFilenameMethod · 0.95
WriteFunction · 0.92

Tested by

no test coverage detected