]> Cypherpunks repositories - gostls13.git/commitdiff
archive/tar: Make Reader and Writer more closely follow io.Reader and io.Writer inter...
authorEvan Shaw <chickencha@gmail.com>
Fri, 20 Nov 2009 04:43:30 +0000 (20:43 -0800)
committerRuss Cox <rsc@golang.org>
Fri, 20 Nov 2009 04:43:30 +0000 (20:43 -0800)
There's no functional change here. io gives the Read and Write methods byte slice arguments, but tar called them uint8. It's the same thing, but I think this is clearer and it matches what other packages do.

R=rsc
CC=golang-dev
https://golang.org/cl/157099

src/pkg/archive/tar/reader.go
src/pkg/archive/tar/writer.go

index 654b5b03d9587ffb60e2e221df278a6d05769a53..74057401f8e98ae48a643feebcd8a3122d019574 100644 (file)
@@ -204,7 +204,7 @@ func (tr *Reader) readHeader() *Header {
 // Read reads from the current entry in the tar archive.
 // It returns 0, nil when it reaches the end of that entry,
 // until Next is called to advance to the next entry.
-func (tr *Reader) Read(b []uint8) (n int, err os.Error) {
+func (tr *Reader) Read(b []byte) (n int, err os.Error) {
        if int64(len(b)) > tr.nb {
                b = b[0:tr.nb]
        }
index 2c207d618f163aa9e993975044a86b73246ade2a..6bb4acdf4031b2340e5ac14be6a05b0e3910aba3 100644 (file)
@@ -163,7 +163,7 @@ func (tw *Writer) WriteHeader(hdr *Header) os.Error {
 // Write writes to the current entry in the tar archive.
 // Write returns the error ErrWriteTooLong if more than
 // hdr.Size bytes are written after WriteHeader.
-func (tw *Writer) Write(b []uint8) (n int, err os.Error) {
+func (tw *Writer) Write(b []byte) (n int, err os.Error) {
        overwrite := false;
        if int64(len(b)) > tw.nb {
                b = b[0:tw.nb];