From 98015c21ecf2efa2dee70895e6d55d361627d786 Mon Sep 17 00:00:00 2001 From: Sebastiaan van Stijn Date: Mon, 16 Jun 2025 16:28:40 +0200 Subject: [PATCH] remove deprecated pkg/atomicwriter The atomicwriter utilities were moved to a separate package in commit 786445479256b74d6dc85089b259ec733cbaab80 (v28.0.0), which in its turn was moved to a separate module in 6422ff2804f9e141d9df5a5943650ecb021da0ad (v28.1.0). Signed-off-by: Sebastiaan van Stijn --- pkg/atomicwriter/atomicwriter_deprecated.go | 56 --------------------- 1 file changed, 56 deletions(-) delete mode 100644 pkg/atomicwriter/atomicwriter_deprecated.go diff --git a/pkg/atomicwriter/atomicwriter_deprecated.go b/pkg/atomicwriter/atomicwriter_deprecated.go deleted file mode 100644 index 82d4559736..0000000000 --- a/pkg/atomicwriter/atomicwriter_deprecated.go +++ /dev/null @@ -1,56 +0,0 @@ -package atomicwriter - -import ( - "io" - "os" - - "github.com/moby/sys/atomicwriter" -) - -// New returns a WriteCloser so that writing to it writes to a -// temporary file and closing it atomically changes the temporary file to -// destination path. Writing and closing concurrently is not allowed. -// NOTE: umask is not considered for the file's permissions. -// -// New uses [sequential.CreateTemp] to use sequential file access on Windows, -// avoiding depleting the standby list un-necessarily. On Linux, this equates to -// a regular [os.CreateTemp]. Refer to the [Win32 API documentation] for details -// on sequential file access. -// -// Deprecated: use [atomicwriter.New] instead. -// -// [Win32 API documentation]: https://learn.microsoft.com/en-us/windows/win32/api/fileapi/nf-fileapi-createfilea#FILE_FLAG_SEQUENTIAL_SCAN -func New(filename string, perm os.FileMode) (io.WriteCloser, error) { - return atomicwriter.New(filename, perm) -} - -// WriteFile atomically writes data to a file named by filename and with the -// specified permission bits. The given filename is created if it does not exist, -// but the destination directory must exist. It can be used as a drop-in replacement -// for [os.WriteFile], but currently does not allow the destination path to be -// a symlink. WriteFile is implemented using [New] for its implementation. -// -// NOTE: umask is not considered for the file's permissions. -// -// Deprecated: use [atomicwriter.WriteFile] instead. -func WriteFile(filename string, data []byte, perm os.FileMode) error { - return atomicwriter.WriteFile(filename, data, perm) -} - -// WriteSet is used to atomically write a set -// of files and ensure they are visible at the same time. -// Must be committed to a new directory. -// -// Deprecated: use [atomicwriter.WriteSet] instead. -type WriteSet = atomicwriter.WriteSet - -// NewWriteSet creates a new atomic write set to -// atomically create a set of files. The given directory -// is used as the base directory for storing files before -// commit. If no temporary directory is given the system -// default is used. -// -// Deprecated: use [atomicwriter.NewWriteSet] instead. -func NewWriteSet(tmpDir string) (*atomicwriter.WriteSet, error) { - return atomicwriter.NewWriteSet(tmpDir) -}