diff options
author | Russ Cox <rsc@golang.org> | 2009-09-14 17:20:29 -0700 |
---|---|---|
committer | Russ Cox <rsc@golang.org> | 2009-09-14 17:20:29 -0700 |
commit | f4275441ce62435cf885411ef2e9801b58562291 (patch) | |
tree | e2cd321c6ad74a89d52d68181a949bc8bfd76198 /src/pkg/archive | |
parent | 518cd591a17af2ee525b83754d6a4e8f78753c33 (diff) | |
download | golang-f4275441ce62435cf885411ef2e9801b58562291.tar.gz |
fix "declared and not used" errors in non-test code.
R=r
DELTA=112 (6 added, 57 deleted, 49 changed)
OCL=34610
CL=34610
Diffstat (limited to 'src/pkg/archive')
-rw-r--r-- | src/pkg/archive/tar/reader.go | 10 | ||||
-rw-r--r-- | src/pkg/archive/tar/writer.go | 8 |
2 files changed, 7 insertions, 11 deletions
diff --git a/src/pkg/archive/tar/reader.go b/src/pkg/archive/tar/reader.go index 479d093e0..1c3df6bfd 100644 --- a/src/pkg/archive/tar/reader.go +++ b/src/pkg/archive/tar/reader.go @@ -95,11 +95,10 @@ func (ignoreWriter) Write(b []byte) (n int, err os.Error) { func (tr *Reader) skipUnread() { nr := tr.nb + tr.pad; // number of bytes to skip - var n int64; if sr, ok := tr.r.(io.Seeker); ok { - n, tr.err = sr.Seek(nr, 1); + _, tr.err = sr.Seek(nr, 1); } else { - n, tr.err = io.Copyn(tr.r, ignoreWriter{}, nr); + _, tr.err = io.Copyn(tr.r, ignoreWriter{}, nr); } tr.nb, tr.pad = 0, 0; } @@ -116,14 +115,13 @@ func (tr *Reader) verifyChecksum(header []byte) bool { func (tr *Reader) readHeader() *Header { header := make([]byte, blockSize); - var n int; - if n, tr.err = io.ReadFull(tr.r, header); tr.err != nil { + if _, tr.err = io.ReadFull(tr.r, header); tr.err != nil { return nil } // Two blocks of zero bytes marks the end of the archive. if bytes.Equal(header, zeroBlock[0:blockSize]) { - if n, tr.err = io.ReadFull(tr.r, header); tr.err != nil { + if _, tr.err = io.ReadFull(tr.r, header); tr.err != nil { return nil } if !bytes.Equal(header, zeroBlock[0:blockSize]) { diff --git a/src/pkg/archive/tar/writer.go b/src/pkg/archive/tar/writer.go index b3ce6b5c1..42e628f5c 100644 --- a/src/pkg/archive/tar/writer.go +++ b/src/pkg/archive/tar/writer.go @@ -109,7 +109,7 @@ func (tw *Writer) WriteHeader(hdr *Header) os.Error { s := slicer(header); // TODO(dsymonds): handle names longer than 100 chars - nr := bytes.Copy(s.next(100), strings.Bytes(hdr.Name)); + bytes.Copy(s.next(100), strings.Bytes(hdr.Name)); tw.octal(s.next(8), hdr.Mode); // 100:108 tw.octal(s.next(8), hdr.Uid); // 108:116 @@ -136,8 +136,7 @@ func (tw *Writer) WriteHeader(hdr *Header) os.Error { return tw.err } - var n int; - n, tw.err = tw.w.Write(header); + _, tw.err = tw.w.Write(header); return tw.err } @@ -169,8 +168,7 @@ func (tw *Writer) Close() os.Error { // trailer: two zero blocks for i := 0; i < 2; i++ { - var n int; - n, tw.err = tw.w.Write(zeroBlock); + _, tw.err = tw.w.Write(zeroBlock); if tw.err != nil { break } |