Improve the name of a function
This commit is contained in:
parent
c8f0a0f9e8
commit
0eb6d199a4
|
@ -327,8 +327,8 @@ func Main(statePath string, processCallback certspotter.ProcessCallback) int {
|
||||||
}
|
}
|
||||||
|
|
||||||
if state.IsFirstRun() && exitCode == 0 {
|
if state.IsFirstRun() && exitCode == 0 {
|
||||||
if err := state.Finish(); err != nil {
|
if err := state.WriteOnceFile(); err != nil {
|
||||||
fmt.Fprintf(os.Stderr, "%s: Error finalizing state: %s\n", os.Args[0], err)
|
fmt.Fprintf(os.Stderr, "%s: Error writing once file: %s\n", os.Args[0], err)
|
||||||
exitCode |= 1
|
exitCode |= 1
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -116,7 +116,7 @@ func (state *State) IsFirstRun() bool {
|
||||||
return !fileExists(filepath.Join(state.path, "once"))
|
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 {
|
if err := ioutil.WriteFile(filepath.Join(state.path, "once"), []byte{}, 0666); err != nil {
|
||||||
return fmt.Errorf("Error writing once file: %s", err)
|
return fmt.Errorf("Error writing once file: %s", err)
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue