From 23c9db657ea7c7552cb8e00debce945b97d61116 Mon Sep 17 00:00:00 2001 From: Awn Date: Mon, 3 Jul 2017 01:36:52 +0100 Subject: [PATCH] archive/tar: remove useless type conversions Change-Id: I259a6ed6a1abc63d2dc39eca7e85f94cf38001cc Reviewed-on: https://go-review.googlesource.com/47342 Reviewed-by: Brad Fitzpatrick Run-TryBot: Brad Fitzpatrick TryBot-Result: Gobot Gobot --- src/archive/tar/format.go | 2 +- src/archive/tar/strconv.go | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/archive/tar/format.go b/src/archive/tar/format.go index cf1289534f..ed61f3ca0d 100644 --- a/src/archive/tar/format.go +++ b/src/archive/tar/format.go @@ -227,7 +227,7 @@ func (b *block) ComputeChecksum() (unsigned, signed int64) { if 148 <= i && i < 156 { c = ' ' // Treat the checksum field itself as all spaces. } - unsigned += int64(uint8(c)) + unsigned += int64(c) signed += int64(int8(c)) } return unsigned, signed diff --git a/src/archive/tar/strconv.go b/src/archive/tar/strconv.go index 8bbd65cd1a..d144485a49 100644 --- a/src/archive/tar/strconv.go +++ b/src/archive/tar/strconv.go @@ -226,9 +226,9 @@ func parsePAXTime(s string) (time.Time, error) { } nsecs, _ := strconv.ParseInt(sn, 10, 64) // Must succeed if len(ss) > 0 && ss[0] == '-' { - return time.Unix(secs, -1*int64(nsecs)), nil // Negative correction + return time.Unix(secs, -1*nsecs), nil // Negative correction } - return time.Unix(secs, int64(nsecs)), nil + return time.Unix(secs, nsecs), nil } // formatPAXTime converts ts into a time of the form %d.%d as described in the