From 42cad4b7dc9673d7f35a8a23a9dd11fe97958c6c Mon Sep 17 00:00:00 2001 From: Colin Cross Date: Fri, 7 Nov 2014 11:28:44 -0800 Subject: [PATCH] Add pathtools.ReplaceExtension Change-Id: I67d08700fce37b7949e6103132212766cdbe54ec --- blueprint/pathtools/lists.go | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/blueprint/pathtools/lists.go b/blueprint/pathtools/lists.go index 3742cf8..46bbf2b 100644 --- a/blueprint/pathtools/lists.go +++ b/blueprint/pathtools/lists.go @@ -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) +}