Skip to content

Commit c167928

Browse files
committed
archive/tar: minor doc fixes
Use "file" consistently instead of "entry". Change-Id: Ia81c9665d0d956adb78f7fa49de40cdb87fba000 Reviewed-on: https://go-review.googlesource.com/60150 Reviewed-by: Ian Lance Taylor <[email protected]>
1 parent f85dc05 commit c167928

File tree

3 files changed

+9
-10
lines changed

3 files changed

+9
-10
lines changed

src/archive/tar/common.go

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ func (he headerError) Error() string {
5656
const (
5757
// Type '0' indicates a regular file.
5858
TypeReg = '0'
59-
TypeRegA = '\x00' // For legacy support (use TypeReg instead)
59+
TypeRegA = '\x00' // For legacy support; use TypeReg instead
6060

6161
// Type '1' to '6' are header-only flags and may not have a data body.
6262
TypeLink = '1' // Hard link
@@ -85,7 +85,7 @@ const (
8585
TypeGNUSparse = 'S'
8686

8787
// Types 'L' and 'K' are used by the GNU format for a meta file
88-
// used to store the path or link name for the next entry.
88+
// used to store the path or link name for the next file.
8989
// This package transparently handles these types.
9090
TypeGNULongName = 'L'
9191
TypeGNULongLink = 'K'
@@ -166,13 +166,12 @@ type Header struct {
166166
//
167167
// A file is sparse if len(SparseHoles) > 0 or Typeflag is TypeGNUSparse.
168168
// If TypeGNUSparse is set, then the format is GNU, otherwise
169-
// the PAX format with GNU-specific record is used.
169+
// the format is PAX (by using GNU-specific PAX records).
170170
//
171171
// A sparse file consists of fragments of data, intermixed with holes
172172
// (described by this field). A hole is semantically a block of NUL-bytes,
173173
// but does not actually exist within the tar file.
174-
// The logical size of the file stored in the Size field, while
175-
// the holes must be sorted in ascending order,
174+
// The holes must be sorted in ascending order,
176175
// not overlap with each other, and not extend past the specified Size.
177176
SparseHoles []SparseEntry
178177

src/archive/tar/reader.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -604,11 +604,11 @@ func readGNUSparseMap0x1(paxHdrs map[string]string) (sparseDatas, error) {
604604
return spd, nil
605605
}
606606

607-
// Read reads from the current entry in the tar archive.
608-
// It returns (0, io.EOF) when it reaches the end of that entry,
609-
// until Next is called to advance to the next entry.
607+
// Read reads from the current file in the tar archive.
608+
// It returns (0, io.EOF) when it reaches the end of that file,
609+
// until Next is called to advance to the next file.
610610
//
611-
// If the current file is sparse, then the regions marked as a sparse hole
611+
// If the current file is sparse, then the regions marked as a hole
612612
// are read back as NUL-bytes.
613613
//
614614
// Calling Read on special types like TypeLink, TypeSymLink, TypeChar,

src/archive/tar/writer.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -389,7 +389,7 @@ func splitUSTARPath(name string) (prefix, suffix string, ok bool) {
389389
// Write returns the error ErrWriteTooLong if more than
390390
// Header.Size bytes are written after WriteHeader.
391391
//
392-
// If the current file is sparse, then the regions marked as a sparse hole
392+
// If the current file is sparse, then the regions marked as a hole
393393
// must be written as NUL-bytes.
394394
//
395395
// Calling Write on special types like TypeLink, TypeSymLink, TypeChar,

0 commit comments

Comments
 (0)