diff --git a/cmd/common.go b/cmd/common.go index a31d512..6aac0b2 100644 --- a/cmd/common.go +++ b/cmd/common.go @@ -327,8 +327,8 @@ func Main(statePath string, processCallback certspotter.ProcessCallback) int { } if state.IsFirstRun() && exitCode == 0 { - if err := state.Finish(); err != nil { - fmt.Fprintf(os.Stderr, "%s: Error finalizing state: %s\n", os.Args[0], err) + if err := state.WriteOnceFile(); err != nil { + fmt.Fprintf(os.Stderr, "%s: Error writing once file: %s\n", os.Args[0], err) exitCode |= 1 } } diff --git a/cmd/state.go b/cmd/state.go index fe1c645..75ef353 100644 --- a/cmd/state.go +++ b/cmd/state.go @@ -116,7 +116,7 @@ func (state *State) IsFirstRun() bool { return !fileExists(filepath.Join(state.path, "once")) } -func (state *State) Finish() error { +func (state *State) WriteOnceFile() error { if err := ioutil.WriteFile(filepath.Join(state.path, "once"), []byte{}, 0666); err != nil { return fmt.Errorf("Error writing once file: %s", err) }