From 0eb6d199a452e0f86dfb1fc46cd8183d7fc2c23b Mon Sep 17 00:00:00 2001 From: Andrew Ayer Date: Fri, 6 Jan 2017 12:24:09 -0800 Subject: [PATCH] Improve the name of a function --- cmd/common.go | 4 ++-- cmd/state.go | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) 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) }