Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(84)

Unified Diff: common/proto/google/util.go

Issue 1870263002: cipd: instance cache (Closed) Base URL: https://chromium.googlesource.com/external/github.com/luci/luci-go@master
Patch Set: cipd: instance cache Created 4 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« client/cmd/cipd/main.go ('K') | « client/cmd/cipd/main.go ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: common/proto/google/util.go
diff --git a/common/proto/google/util.go b/common/proto/google/util.go
index 755b2f2609d5609c11d55fb334d6b4163548d89a..d5964ddfa080088c74c3440f69a86be60da0aec7 100644
--- a/common/proto/google/util.go
+++ b/common/proto/google/util.go
@@ -24,6 +24,12 @@ func NewTimestamp(t time.Time) *Timestamp {
}
}
+// FromTime sets t to the timestamp of the given time.Time value.
+func (t *Timestamp) FromTime(other time.Time) {
Vadim Sh. 2016/04/11 16:52:03 what if 'other' is Zero? other.Unix() returns som
nodir 2016/04/11 22:16:16 Done.
+ t.Seconds = other.Unix()
+ t.Nanos = int32(other.Nanosecond())
+}
+
// Time returns the time.Time associated with a Timestamp protobuf.
func (t *Timestamp) Time() time.Time {
if t == nil {
« client/cmd/cipd/main.go ('K') | « client/cmd/cipd/main.go ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698