1
0
Fork 1
mirror of https://github.com/vbatts/tar-split.git synced 2024-11-18 14:28:38 +00:00

all: remove unnecessary type conversions

cmd and runtime were handled separately, and I'm intentionally skipped
syscall. This is the rest of the standard library.

CL generated mechanically with github.com/mdempsky/unconvert.

Change-Id: I9e0eff886974dedc37adb93f602064b83e469122
Reviewed-on: https://go-review.googlesource.com/22104
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
Run-TryBot: Matthew Dempsky <mdempsky@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Signed-off-by: Vincent Batts <vbatts@hashbangbash.com>
This commit is contained in:
Matthew Dempsky 2016-04-14 19:09:36 -07:00 committed by Vincent Batts
parent 67735b8612
commit c9d534b830
2 changed files with 5 additions and 5 deletions

View file

@ -340,7 +340,7 @@ func mergePAX(hdr *Header, headers map[string]string) error {
if err != nil { if err != nil {
return err return err
} }
hdr.Size = int64(size) hdr.Size = size
default: default:
if strings.HasPrefix(k, paxXattr) { if strings.HasPrefix(k, paxXattr) {
if hdr.Xattrs == nil { if hdr.Xattrs == nil {
@ -380,7 +380,7 @@ func parsePAXTime(t string) (time.Time, error) {
// Right truncate // Right truncate
nano_buf = nano_buf[:maxNanoSecondIntSize] nano_buf = nano_buf[:maxNanoSecondIntSize]
} }
nanoseconds, err = strconv.ParseInt(string(nano_buf), 10, 0) nanoseconds, err = strconv.ParseInt(nano_buf, 10, 0)
if err != nil { if err != nil {
return time.Time{}, err return time.Time{}, err
} }
@ -418,14 +418,14 @@ func parsePAX(r io.Reader) (map[string]string, error) {
} }
sbuf = residual sbuf = residual
keyStr := string(key) keyStr := key
if keyStr == paxGNUSparseOffset || keyStr == paxGNUSparseNumBytes { if keyStr == paxGNUSparseOffset || keyStr == paxGNUSparseNumBytes {
// GNU sparse format 0.0 special key. Write to sparseMap instead of using the headers map. // GNU sparse format 0.0 special key. Write to sparseMap instead of using the headers map.
sparseMap.WriteString(value) sparseMap.WriteString(value)
sparseMap.Write([]byte{','}) sparseMap.Write([]byte{','})
} else { } else {
// Normal key. Set the value in the headers map. // Normal key. Set the value in the headers map.
headers[keyStr] = string(value) headers[keyStr] = value
} }
} }
if sparseMap.Len() != 0 { if sparseMap.Len() != 0 {

View file

@ -278,7 +278,7 @@ func (tw *Writer) writeHeader(hdr *Header, allowPax bool) error {
return err return err
} }
} }
tw.nb = int64(hdr.Size) tw.nb = hdr.Size
tw.pad = (blockSize - (tw.nb % blockSize)) % blockSize tw.pad = (blockSize - (tw.nb % blockSize)) % blockSize
_, tw.err = tw.w.Write(header) _, tw.err = tw.w.Write(header)