From 13267b2d5ab2b3a74e009789039d08840f3bc7ac Mon Sep 17 00:00:00 2001 From: William Petit Date: Thu, 20 Sep 2018 11:36:48 +0200 Subject: [PATCH] Rename TimeSyncStatus() to TimeSynced() for API clarity --- example/updater/main.go | 2 +- reach/time_sync.go | 5 +++-- reach/time_sync_test.go | 2 +- 3 files changed, 5 insertions(+), 4 deletions(-) diff --git a/example/updater/main.go b/example/updater/main.go index c910a14..b2b944f 100644 --- a/example/updater/main.go +++ b/example/updater/main.go @@ -113,7 +113,7 @@ func updateThenReboot() { defer updater.Close() log.Println("checking time sync") - synced, err := updater.TimeSyncStatus() + synced, err := updater.TimeSynced() if err != nil { log.Fatal(err) } diff --git a/reach/time_sync.go b/reach/time_sync.go index d9f8c96..b4e90eb 100644 --- a/reach/time_sync.go +++ b/reach/time_sync.go @@ -16,8 +16,9 @@ type timeSyncStatus struct { Status bool `json:"status"` } -// TimeSyncStatus returns the ReachRS module time sync status -func (u *Updater) TimeSyncStatus() (bool, error) { +// TimeSynced returns the ReachRS module time synchronization status. +// A true response means that the module has synchronized its clock. +func (u *Updater) TimeSynced() (bool, error) { var err error var synced bool diff --git a/reach/time_sync_test.go b/reach/time_sync_test.go index c6a6682..af81b70 100644 --- a/reach/time_sync_test.go +++ b/reach/time_sync_test.go @@ -18,7 +18,7 @@ func TestClientTimeSync(t *testing.T) { t.Fatal(err) } - _, err := client.TimeSyncStatus() + _, err := client.TimeSynced() if err != nil { t.Error(err) }