Skip to content

Commit 9b510e9

Browse files
committed
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]>
1 parent 8bf975b commit 9b510e9

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
@@ -341,6 +341,7 @@ func createTarFile(ctx context.Context, path, extractDir string, hdr *tar.Header
341341
}
342342
}
343343

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

images/archive/importer.go

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

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

0 commit comments

Comments
 (0)