Rename TimeSyncStatus() to TimeSynced() for API clarity
This commit is contained in:
parent
6534c51fe4
commit
13267b2d5a
|
@ -113,7 +113,7 @@ func updateThenReboot() {
|
||||||
defer updater.Close()
|
defer updater.Close()
|
||||||
|
|
||||||
log.Println("checking time sync")
|
log.Println("checking time sync")
|
||||||
synced, err := updater.TimeSyncStatus()
|
synced, err := updater.TimeSynced()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
log.Fatal(err)
|
log.Fatal(err)
|
||||||
}
|
}
|
||||||
|
|
|
@ -16,8 +16,9 @@ type timeSyncStatus struct {
|
||||||
Status bool `json:"status"`
|
Status bool `json:"status"`
|
||||||
}
|
}
|
||||||
|
|
||||||
// TimeSyncStatus returns the ReachRS module time sync status
|
// TimeSynced returns the ReachRS module time synchronization status.
|
||||||
func (u *Updater) TimeSyncStatus() (bool, error) {
|
// A true response means that the module has synchronized its clock.
|
||||||
|
func (u *Updater) TimeSynced() (bool, error) {
|
||||||
|
|
||||||
var err error
|
var err error
|
||||||
var synced bool
|
var synced bool
|
||||||
|
|
|
@ -18,7 +18,7 @@ func TestClientTimeSync(t *testing.T) {
|
||||||
t.Fatal(err)
|
t.Fatal(err)
|
||||||
}
|
}
|
||||||
|
|
||||||
_, err := client.TimeSyncStatus()
|
_, err := client.TimeSynced()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
t.Error(err)
|
t.Error(err)
|
||||||
}
|
}
|
||||||
|
|
Reference in New Issue