Skip to content

Commit 7ce1edd

Browse files
committed
pkg/archive: deprecate NewTempArchive, TempArchive
These were added in baacae8, but are currently only used in tests inside pkg/archive. There are no external users of this function, so we should deprecated them. Signed-off-by: Sebastiaan van Stijn <[email protected]>
1 parent d1273b2 commit 7ce1edd

1 file changed

Lines changed: 4 additions & 0 deletions

File tree

pkg/archive/archive.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1452,6 +1452,8 @@ func cmdStream(cmd *exec.Cmd, input io.Reader) (io.ReadCloser, error) {
14521452
// NewTempArchive reads the content of src into a temporary file, and returns the contents
14531453
// of that file as an archive. The archive can only be read once - as soon as reading completes,
14541454
// the file will be deleted.
1455+
//
1456+
// Deprecated: NewTempArchive is only used in tests and will be removed in the next release.
14551457
func NewTempArchive(src io.Reader, dir string) (*TempArchive, error) {
14561458
f, err := os.CreateTemp(dir, "")
14571459
if err != nil {
@@ -1473,6 +1475,8 @@ func NewTempArchive(src io.Reader, dir string) (*TempArchive, error) {
14731475

14741476
// TempArchive is a temporary archive. The archive can only be read once - as soon as reading completes,
14751477
// the file will be deleted.
1478+
//
1479+
// Deprecated: TempArchive is only used in tests and will be removed in the next release.
14761480
type TempArchive struct {
14771481
*os.File
14781482
Size int64 // Pre-computed from Stat().Size() as a convenience

0 commit comments

Comments
 (0)