From 92b8d93f472980eb5249a6140a42900894713ec2 Mon Sep 17 00:00:00 2001 From: Sebastiaan van Stijn Date: Sun, 16 Jun 2024 16:56:25 +0200 Subject: [PATCH] pkg/archive: deprecate CanonicalTarNameForPath Commit d59758450b6bb876867beadc5cd7be2d1805687c changed this function to be a wrapper for `filepath.ToSlash`. It was used in the CLI for the classic builder, but is no longer used in our codebase. However, there may still be some consumers that copied the CLI code for the classic builder that didn't synchronise their implementation yet, so let's deprecate this function to give them a warning that they should no longer use this. Signed-off-by: Sebastiaan van Stijn --- pkg/archive/archive.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/pkg/archive/archive.go b/pkg/archive/archive.go index 3418cfc50e..5aa273a514 100644 --- a/pkg/archive/archive.go +++ b/pkg/archive/archive.go @@ -541,8 +541,10 @@ func newTarAppender(idMapping idtools.IdentityMapping, writer io.Writer, chownOp } // CanonicalTarNameForPath canonicalizes relativePath to a POSIX-style path using -// forward slashes. It is an alias for filepath.ToSlash, which is a no-op on +// forward slashes. It is an alias for [filepath.ToSlash], which is a no-op on // Linux and Unix. +// +// Deprecated: use [filepath.ToSlash]. This function will be removed in the next release. func CanonicalTarNameForPath(relativePath string) string { return filepath.ToSlash(relativePath) }