Skip to content

Commit fec784a

Browse files
AkihiroSudathaJeztah
authored andcommitted
lint: silence "SA1019: tar.TypeRegA has been deprecated... (staticheck)"
"SA1019: tar.TypeRegA has been deprecated since Go 1.11 and an alternative has been available since Go 1.1: Use TypeReg instead. (staticcheck)" Signed-off-by: Akihiro Suda <[email protected]> (cherry picked from commit 9b510e9) Signed-off-by: Sebastiaan van Stijn <[email protected]>
1 parent 6648df1 commit fec784a

2 files changed

Lines changed: 2 additions & 0 deletions

File tree

archive/tar.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -332,6 +332,7 @@ func createTarFile(ctx context.Context, path, extractDir string, hdr *tar.Header
332332
}
333333
}
334334

335+
//nolint:staticcheck // TypeRegA is deprecated but we may still receive an external tar with TypeRegA
335336
case tar.TypeReg, tar.TypeRegA:
336337
file, err := openFile(path, os.O_WRONLY|os.O_CREATE|os.O_TRUNC, hdrInfo.Mode())
337338
if err != nil {

images/archive/importer.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -94,6 +94,7 @@ func ImportIndex(ctx context.Context, store content.Store, reader io.Reader, opt
9494
symlinks[hdr.Name] = path.Join(path.Dir(hdr.Name), hdr.Linkname)
9595
}
9696

97+
//nolint:staticcheck // TypeRegA is deprecated but we may still receive an external tar with TypeRegA
9798
if hdr.Typeflag != tar.TypeReg && hdr.Typeflag != tar.TypeRegA {
9899
if hdr.Typeflag != tar.TypeDir {
99100
log.G(ctx).WithField("file", hdr.Name).Debug("file type ignored")

0 commit comments

Comments
 (0)