From c7e6a889b80a7054480bccc12732cfdd765b6e4e Mon Sep 17 00:00:00 2001 From: Sebastiaan van Stijn Date: Fri, 14 Oct 2022 10:41:23 +0200 Subject: [PATCH] sys: remove unused IsAbs() (windows) This function was forked from Moby in 6089c1525b665876307d43fb94f9e8ed76eb40a1, which copied the whole file, but the `IsAbs()` was never used, and has no external consumers, so let's remove it. Signed-off-by: Sebastiaan van Stijn --- sys/filesys_windows.go | 18 ------------------ 1 file changed, 18 deletions(-) diff --git a/sys/filesys_windows.go b/sys/filesys_windows.go index 3d76be672..12407301d 100644 --- a/sys/filesys_windows.go +++ b/sys/filesys_windows.go @@ -18,9 +18,7 @@ package sys import ( "os" - "path/filepath" "regexp" - "strings" "syscall" "unsafe" @@ -134,19 +132,3 @@ func mkdirWithACL(name string) error { } return nil } - -// IsAbs is a platform-specific wrapper for filepath.IsAbs. On Windows, -// golang filepath.IsAbs does not consider a path \windows\system32 as absolute -// as it doesn't start with a drive-letter/colon combination. However, in -// docker we need to verify things such as WORKDIR /windows/system32 in -// a Dockerfile (which gets translated to \windows\system32 when being processed -// by the daemon. This SHOULD be treated as absolute from a docker processing -// perspective. -func IsAbs(path string) bool { - if !filepath.IsAbs(path) { - if !strings.HasPrefix(path, string(os.PathSeparator)) { - return false - } - } - return true -}