containerfs_windows.go 422 B

123456789101112131415
  1. package containerfs // import "github.com/docker/docker/pkg/containerfs"
  2. import "path/filepath"
  3. // CleanScopedPath removes the C:\ syntax, and prepares to combine
  4. // with a volume path
  5. func CleanScopedPath(path string) string {
  6. if len(path) >= 2 {
  7. c := path[0]
  8. if path[1] == ':' && ('a' <= c && c <= 'z' || 'A' <= c && c <= 'Z') {
  9. path = path[2:]
  10. }
  11. }
  12. return filepath.Join(string(filepath.Separator), path)
  13. }