Add pathtools.ReplaceExtension

Change-Id: I67d08700fce37b7949e6103132212766cdbe54ec
This commit is contained in:
Colin Cross 2014-11-07 11:28:44 -08:00
parent 46f8d184fb
commit 42cad4b7dc

View file

@ -23,7 +23,11 @@ func PrefixPaths(paths []string, prefix string) []string {
func ReplaceExtensions(paths []string, extension string) []string {
result := make([]string, len(paths))
for i, path := range paths {
result[i] = replaceRegexp.ReplaceAllString(path, "."+extension)
result[i] = ReplaceExtension(path, extension)
}
return result
}
func ReplaceExtension(path string, extension string) string {
return replaceRegexp.ReplaceAllString(path, "."+extension)
}