• Joe Tsai's avatar
    archive/tar: partially revert sparse file support · ba2835db
    Joe Tsai authored
    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/78030Reviewed-by: 's avatarRuss Cox <rsc@golang.org>
    ba2835db
example_test.go 1.44 KB