From 88274f4805fe18f7802e737c03fc9dec78767bca Mon Sep 17 00:00:00 2001 From: Sebastiaan van Stijn Date: Tue, 5 Aug 2025 21:11:47 +0200 Subject: [PATCH] cli/command: remove deprecated CopyToFile utility It was deprecated in 7cc6b8ebf4aa1754ac9309027f315b270ea47c34, which is part of v28.x Signed-off-by: Sebastiaan van Stijn (cherry picked from commit de543475180cca011872b174b333b9663e59f112) Signed-off-by: Sebastiaan van Stijn --- cli/command/utils.go | 14 -------------- 1 file changed, 14 deletions(-) diff --git a/cli/command/utils.go b/cli/command/utils.go index ab64ef8fc1..f024ffd278 100644 --- a/cli/command/utils.go +++ b/cli/command/utils.go @@ -14,24 +14,10 @@ import ( "github.com/docker/cli/cli/streams" "github.com/docker/cli/internal/prompt" "github.com/docker/docker/api/types/filters" - "github.com/moby/sys/atomicwriter" "github.com/pkg/errors" "github.com/spf13/pflag" ) -// CopyToFile writes the content of the reader to the specified file -// -// Deprecated: use [atomicwriter.New]. -func CopyToFile(outfile string, r io.Reader) error { - writer, err := atomicwriter.New(outfile, 0o600) - if err != nil { - return err - } - defer writer.Close() - _, err = io.Copy(writer, r) - return err -} - const ErrPromptTerminated = prompt.ErrTerminated // DisableInputEcho disables input echo on the provided streams.In.