From 245403c324d6ea47167227ee70aaef1c4c87ff43 Mon Sep 17 00:00:00 2001 From: Vincent Batts Date: Mon, 13 Mar 2017 18:33:27 -0400 Subject: [PATCH 1/2] travis: test more go versions Thanks to @tianon, for pointing to https://github.com/travis-ci/travis-build/blob/5e3ef60b0d43b8ef56fb6fa77ba3269fbf945fa6/lib/travis/build/config.rb#L54-L70 Signed-off-by: Vincent Batts --- .travis.yml | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/.travis.yml b/.travis.yml index 2d9a842..dcce57a 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,8 +1,11 @@ language: go go: - tip - - 1.6.2 - - 1.5.4 + - 1.x + - 1.8.x + - 1.7.x + - 1.6.x + - 1.5.x # let us have pretty, fast Docker-based Travis workers! sudo: false From c6dd42815acecceec10987978f48488c37ead18f Mon Sep 17 00:00:00 2001 From: Vincent Batts Date: Tue, 14 Mar 2017 11:04:10 -0400 Subject: [PATCH 2/2] archive/tar: monotonic clock adjustment commit 0e3355903d2ebcf5ee9e76096f51ac9a116a9dbb upstream Signed-off-by: Vincent Batts --- archive/tar/tar_test.go | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/archive/tar/tar_test.go b/archive/tar/tar_test.go index d63c072..9ef319a 100644 --- a/archive/tar/tar_test.go +++ b/archive/tar/tar_test.go @@ -94,13 +94,12 @@ func TestRoundTrip(t *testing.T) { var b bytes.Buffer tw := NewWriter(&b) hdr := &Header{ - Name: "file.txt", - Uid: 1 << 21, // too big for 8 octal digits - Size: int64(len(data)), - ModTime: time.Now(), + Name: "file.txt", + Uid: 1 << 21, // too big for 8 octal digits + Size: int64(len(data)), + // https://github.com/golang/go/commit/0e3355903d2ebcf5ee9e76096f51ac9a116a9dbb#diff-d7bf2a98d7b57b6ff754ca406f1b7581R105 + ModTime: time.Now().AddDate(0, 0, 0).Round(1 * time.Second), } - // tar only supports second precision. - hdr.ModTime = hdr.ModTime.Add(-time.Duration(hdr.ModTime.Nanosecond()) * time.Nanosecond) if err := tw.WriteHeader(hdr); err != nil { t.Fatalf("tw.WriteHeader: %v", err) }