IsAbs is a platform-agnostic 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
(path string)
| 330 | // by the daemon). This SHOULD be treated as absolute from a docker processing |
| 331 | // perspective. |
| 332 | func isAbs(path string) bool { |
| 333 | return filepath.IsAbs(path) || strings.HasPrefix(path, string(os.PathSeparator)) |
| 334 | } |
| 335 | |
| 336 | func splitCpArg(arg string) (ctr, path string) { |
| 337 | if isAbs(arg) { |
no outgoing calls
no test coverage detected