Add UTCNow() function. (#3931)

This patch adds UTCNow() function which returns current UTC time.

This is equivalent of UTCNow() == time.Now().UTC()
This commit is contained in:
Bala FA
2017-03-18 23:58:41 +05:30
committed by Harshavardhana
parent 3a6111eff5
commit 1c97dcb10a
52 changed files with 154 additions and 154 deletions

View File

@@ -20,7 +20,6 @@ import (
"encoding/json"
"net/url"
"testing"
"time"
)
func testAdminCmd(cmd cmdType, t *testing.T) {
@@ -40,7 +39,7 @@ func testAdminCmd(cmd cmdType, t *testing.T) {
Username: creds.AccessKey,
Password: creds.SecretKey,
Version: Version,
RequestTime: time.Now().UTC(),
RequestTime: UTCNow(),
}
reply := LoginRPCReply{}
err = adminServer.Login(&args, &reply)
@@ -99,7 +98,7 @@ func TestReInitDisks(t *testing.T) {
Username: creds.AccessKey,
Password: creds.SecretKey,
Version: Version,
RequestTime: time.Now().UTC(),
RequestTime: UTCNow(),
}
reply := LoginRPCReply{}
err = adminServer.Login(&args, &reply)
@@ -124,7 +123,7 @@ func TestReInitDisks(t *testing.T) {
Username: creds.AccessKey,
Password: creds.SecretKey,
Version: Version,
RequestTime: time.Now().UTC(),
RequestTime: UTCNow(),
}
fsReply := LoginRPCReply{}
err = fsAdminServer.Login(&fsArgs, &fsReply)
@@ -161,7 +160,7 @@ func TestGetConfig(t *testing.T) {
Username: creds.AccessKey,
Password: creds.SecretKey,
Version: Version,
RequestTime: time.Now().UTC(),
RequestTime: UTCNow(),
}
reply := LoginRPCReply{}
err = adminServer.Login(&args, &reply)
@@ -205,7 +204,7 @@ func TestWriteAndCommitConfig(t *testing.T) {
Username: creds.AccessKey,
Password: creds.SecretKey,
Version: Version,
RequestTime: time.Now().UTC(),
RequestTime: UTCNow(),
}
reply := LoginRPCReply{}
err = adminServer.Login(&args, &reply)