]> Cypherpunks repositories - gostls13.git/commit
archive/tar: partially revert sparse file support
authorJoe Tsai <joetsai@digital-static.net>
Wed, 15 Nov 2017 19:27:10 +0000 (11:27 -0800)
committerJoe Tsai <thebrokentoaster@gmail.com>
Thu, 16 Nov 2017 16:54:08 +0000 (16:54 +0000)
commitba2835db6ce72dc941ee8a1492c49176ed3bf9f7
tree354f15c785b23db5fb253a4af75acc2f1e5181c8
parentca886e0673ab1e199b722d4828b35f6a9c995cbf
archive/tar: partially revert sparse file support

This CL removes the following APIs:
type SparseEntry struct{ ... }
type Header struct{ SparseHoles []SparseEntry; ... }
func (*Header) DetectSparseHoles(f *os.File) error
func (*Header) PunchSparseHoles(f *os.File) error
func (*Reader) WriteTo(io.Writer) (int, error)
func (*Writer) ReadFrom(io.Reader) (int, error)

This API was added during the Go1.10 dev cycle, and are safe to remove.

The rationale for reverting is because Header.DetectSparseHoles and
Header.PunchSparseHoles are functionality that probably better belongs in
the os package itself.

The other API like Header.SparseHoles, Reader.WriteTo, and Writer.ReadFrom
perform no OS specific logic and only perform the actual business logic of
reading and writing sparse archives. Since we do know know what the API added to
package os may look like, we preemptively revert these non-OS specific changes
as well by simply commenting them out.

Updates #13548
Updates #22735

Change-Id: I77842acd39a43de63e5c754bfa1c26cc24687b70
Reviewed-on: https://go-review.googlesource.com/78030
Reviewed-by: Russ Cox <rsc@golang.org>
src/archive/tar/common.go
src/archive/tar/example_test.go
src/archive/tar/format.go
src/archive/tar/reader.go
src/archive/tar/reader_test.go
src/archive/tar/sparse_unix.go [deleted file]
src/archive/tar/sparse_windows.go [deleted file]
src/archive/tar/tar_test.go
src/archive/tar/writer.go
src/archive/tar/writer_test.go