From 88b9193bae033798f8f979fb8618a74c9af3cba7 Mon Sep 17 00:00:00 2001 From: Nalin Dahyabhai Date: Fri, 29 Sep 2017 17:25:19 -0400 Subject: [PATCH] Fix builds with go 1.7 The skopeo package builds on Darwin use Go 1.7, so make sure we can build on it, by replacing a call to time.Until(t) with t.Sub(time.Now()), as suggested in the standard library documentation. Signed-off-by: Nalin Dahyabhai --- .travis.yml | 1 + drivers/fsdiff.go | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index 892344e574..4be7ab78c4 100644 --- a/.travis.yml +++ b/.travis.yml @@ -2,6 +2,7 @@ language: go go: - tip - 1.8 + - 1.7 dist: trusty sudo: required before_install: diff --git a/drivers/fsdiff.go b/drivers/fsdiff.go index e94947d72b..48a1f078f0 100644 --- a/drivers/fsdiff.go +++ b/drivers/fsdiff.go @@ -94,7 +94,7 @@ func (gdw *NaiveDiffDriver) Diff(id, parent string) (arch io.ReadCloser, err err // are extracted from tar's with full second precision on modified time. // We need this hack here to make sure calls within same second receive // correct result. - time.Sleep(time.Until(startTime.Truncate(time.Second).Add(time.Second))) + time.Sleep(startTime.Truncate(time.Second).Add(time.Second).Sub(time.Now())) return err }), nil }