moby/pkg/containerfs/containerfs.go
Sebastiaan van Stijn 844ca49743
pkg/containerfs: remove deprecated ResolveScopedPath
This function was deprecated in b8f2caa80a
(v25.0), and is no longer in use.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2024-01-20 01:27:07 +01:00

15 lines
529 B
Go

package containerfs // import "github.com/docker/docker/pkg/containerfs"
import "path/filepath"
// CleanScopedPath prepares the given path to be combined with a mount path or
// a drive-letter. On Windows, it removes any existing driveletter (e.g. "C:").
// The returned path is always prefixed with a [filepath.Separator].
func CleanScopedPath(path string) string {
if len(path) >= 2 {
if v := filepath.VolumeName(path); len(v) > 0 {
path = path[len(v):]
}
}
return filepath.Join(string(filepath.Separator), path)
}