]> Cypherpunks repositories - gostls13.git/commitdiff
archive/tar: minor doc fixes
authorJoe Tsai <joetsai@digital-static.net>
Sat, 26 Aug 2017 09:12:56 +0000 (02:12 -0700)
committerJoe Tsai <thebrokentoaster@gmail.com>
Wed, 30 Aug 2017 18:01:08 +0000 (18:01 +0000)
Use "file" consistently instead of "entry".

Change-Id: Ia81c9665d0d956adb78f7fa49de40cdb87fba000
Reviewed-on: https://go-review.googlesource.com/60150
Reviewed-by: Ian Lance Taylor <iant@golang.org>
src/archive/tar/common.go
src/archive/tar/reader.go
src/archive/tar/writer.go

index 21cfa7993b8e655567ab88ae4e1db7590243f32a..c67115e49db79d8342367f550b07d71523c6fb8a 100644 (file)
@@ -56,7 +56,7 @@ func (he headerError) Error() string {
 const (
        // Type '0' indicates a regular file.
        TypeReg  = '0'
-       TypeRegA = '\x00' // For legacy support (use TypeReg instead)
+       TypeRegA = '\x00' // For legacy support; use TypeReg instead
 
        // Type '1' to '6' are header-only flags and may not have a data body.
        TypeLink    = '1' // Hard link
@@ -85,7 +85,7 @@ const (
        TypeGNUSparse = 'S'
 
        // Types 'L' and 'K' are used by the GNU format for a meta file
-       // used to store the path or link name for the next entry.
+       // used to store the path or link name for the next file.
        // This package transparently handles these types.
        TypeGNULongName = 'L'
        TypeGNULongLink = 'K'
@@ -166,13 +166,12 @@ type Header struct {
        //
        // A file is sparse if len(SparseHoles) > 0 or Typeflag is TypeGNUSparse.
        // If TypeGNUSparse is set, then the format is GNU, otherwise
-       // the PAX format with GNU-specific record is used.
+       // the format is PAX (by using GNU-specific PAX records).
        //
        // A sparse file consists of fragments of data, intermixed with holes
        // (described by this field). A hole is semantically a block of NUL-bytes,
        // but does not actually exist within the tar file.
-       // The logical size of the file stored in the Size field, while
-       // the holes must be sorted in ascending order,
+       // The holes must be sorted in ascending order,
        // not overlap with each other, and not extend past the specified Size.
        SparseHoles []SparseEntry
 
index 0cf2a221e9633806e8bab1a8e2cc45fc0f003008..dc0c95a00a8affb5caa37909b9936de81785ef39 100644 (file)
@@ -604,11 +604,11 @@ func readGNUSparseMap0x1(paxHdrs map[string]string) (sparseDatas, error) {
        return spd, nil
 }
 
-// Read reads from the current entry in the tar archive.
-// It returns (0, io.EOF) when it reaches the end of that entry,
-// until Next is called to advance to the next entry.
+// Read reads from the current file in the tar archive.
+// It returns (0, io.EOF) when it reaches the end of that file,
+// until Next is called to advance to the next file.
 //
-// If the current file is sparse, then the regions marked as a sparse hole
+// If the current file is sparse, then the regions marked as a hole
 // are read back as NUL-bytes.
 //
 // Calling Read on special types like TypeLink, TypeSymLink, TypeChar,
index 426c61f34257c8e9593b95a3a676286ef9fe89d6..26491ddc079469e99f31f23fa2d90d130858ff55 100644 (file)
@@ -389,7 +389,7 @@ func splitUSTARPath(name string) (prefix, suffix string, ok bool) {
 // Write returns the error ErrWriteTooLong if more than
 // Header.Size bytes are written after WriteHeader.
 //
-// If the current file is sparse, then the regions marked as a sparse hole
+// If the current file is sparse, then the regions marked as a hole
 // must be written as NUL-bytes.
 //
 // Calling Write on special types like TypeLink, TypeSymLink, TypeChar,