From 35eef25f4ad81be68f96ed5037a9d76bf853f132 Mon Sep 17 00:00:00 2001 From: Andrew Ayer Date: Thu, 18 Feb 2016 10:09:33 -0800 Subject: [PATCH] Rename function for clarity --- cmd/common.go | 4 ++-- helpers.go | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/cmd/common.go b/cmd/common.go index faa4ae8..49f9612 100644 --- a/cmd/common.go +++ b/cmd/common.go @@ -127,7 +127,7 @@ func Main (argStateDir string, processCallback ctwatch.ProcessCallback) { os.Exit(3) } stateFilename := filepath.Join(stateDir, "sths", defangLogUri(logUri)) - prevSTH, err := ctwatch.ReadStateFile(stateFilename) + prevSTH, err := ctwatch.ReadSTHFile(stateFilename) if err != nil { fmt.Fprintf(os.Stderr, "%s: Error reading state file: %s: %s\n", os.Args[0], stateFilename, err) os.Exit(3) @@ -192,7 +192,7 @@ func Main (argStateDir string, processCallback ctwatch.ProcessCallback) { } } - if err := ctwatch.WriteStateFile(stateFilename, latestSTH); err != nil { + if err := ctwatch.WriteSTHFile(stateFilename, latestSTH); err != nil { fmt.Fprintf(os.Stderr, "%s: Error writing state file: %s: %s\n", os.Args[0], stateFilename, err) os.Exit(3) } diff --git a/helpers.go b/helpers.go index 88f14dd..090ccc4 100644 --- a/helpers.go +++ b/helpers.go @@ -22,7 +22,7 @@ import ( "github.com/google/certificate-transparency/go/x509/pkix" ) -func ReadStateFile (path string) (*ct.SignedTreeHead, error) { +func ReadSTHFile (path string) (*ct.SignedTreeHead, error) { content, err := ioutil.ReadFile(path) if err != nil { if os.IsNotExist(err) { @@ -39,7 +39,7 @@ func ReadStateFile (path string) (*ct.SignedTreeHead, error) { return &sth, nil } -func WriteStateFile (path string, sth *ct.SignedTreeHead) error { +func WriteSTHFile (path string, sth *ct.SignedTreeHead) error { sthJson, err := json.MarshalIndent(sth, "", "\t") if err != nil { return err