Improve the name of a function

This commit is contained in:
Andrew Ayer 2017-01-06 12:24:09 -08:00
parent c8f0a0f9e8
commit 0eb6d199a4
2 changed files with 3 additions and 3 deletions

View File

@ -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
}
}

View File

@ -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)
}