Fix all remaining windows path issues.

This commit is contained in:
Harshavardhana
2015-10-21 22:25:13 -07:00
parent 8978c19db6
commit 1f66f4869b
5 changed files with 49 additions and 12 deletions

View File

@@ -31,6 +31,20 @@ type Metadata struct {
ContentType string
}
// sanitizeWindowsPath - sanitize a path
func sanitizeWindowsPath(path string) string {
return strings.Replace(path, "\\", "/", -1)
}
// sanitizeWindowsPaths - sanitize some windows paths
func sanitizeWindowsPaths(paths ...string) []string {
var results []string
for _, path := range paths {
results = append(results, sanitizeWindowsPath(path))
}
return results
}
// sortUnique sort a slice in lexical order, removing duplicate elements
func sortUnique(objects []string) []string {
results := []string{}