@@ -37,8 +37,8 @@ func NormalizePath(parent, newPath, inputOS string, keepSlash bool) (string, err
3737 inputOS = "linux"
3838 }
3939
40- newPath = toSlash (newPath , inputOS )
41- parent = toSlash (parent , inputOS )
40+ newPath = ToSlash (newPath , inputOS )
41+ parent = ToSlash (parent , inputOS )
4242 origPath := newPath
4343
4444 if parent == "" {
@@ -82,18 +82,18 @@ func NormalizePath(parent, newPath, inputOS string, keepSlash bool) (string, err
8282 }
8383 }
8484
85- return toSlash (newPath , inputOS ), nil
85+ return ToSlash (newPath , inputOS ), nil
8686}
8787
88- func toSlash (inputPath , inputOS string ) string {
88+ func ToSlash (inputPath , inputOS string ) string {
8989 separator := "/"
9090 if inputOS == "windows" {
9191 separator = "\\ "
9292 }
9393 return strings .Replace (inputPath , separator , "/" , - 1 )
9494}
9595
96- func fromSlash (inputPath , inputOS string ) string {
96+ func FromSlash (inputPath , inputOS string ) string {
9797 separator := "/"
9898 if inputOS == "windows" {
9999 separator = "\\ "
@@ -119,7 +119,7 @@ func NormalizeWorkdir(current, wd string, inputOS string) (string, error) {
119119
120120 // Make sure we use the platform specific path separator. HCS does not like forward
121121 // slashes in CWD.
122- return fromSlash (wd , inputOS ), nil
122+ return FromSlash (wd , inputOS ), nil
123123}
124124
125125// IsAbs returns a boolean value indicating whether or not the path
@@ -142,7 +142,7 @@ func IsAbs(pth, inputOS string) bool {
142142 if err != nil {
143143 return false
144144 }
145- cleanedPath = toSlash (cleanedPath , inputOS )
145+ cleanedPath = ToSlash (cleanedPath , inputOS )
146146 // We stripped any potential drive letter and converted any backslashes to
147147 // forward slashes. We can safely use path.IsAbs() for both Windows and Linux.
148148 return path .IsAbs (cleanedPath )
@@ -189,14 +189,14 @@ func CheckSystemDriveAndRemoveDriveLetter(path string, inputOS string) (string,
189189 }
190190
191191 // UNC paths should error out
192- if len (path ) >= 2 && toSlash (path [:2 ], inputOS ) == "//" {
192+ if len (path ) >= 2 && ToSlash (path [:2 ], inputOS ) == "//" {
193193 return "" , errors .Errorf ("UNC paths are not supported" )
194194 }
195195
196196 parts := strings .SplitN (path , ":" , 2 )
197197 // Path does not have a drive letter. Just return it.
198198 if len (parts ) < 2 {
199- return toSlash (filepath .Clean (path ), inputOS ), nil
199+ return ToSlash (filepath .Clean (path ), inputOS ), nil
200200 }
201201
202202 // We expect all paths to be in C:
@@ -221,5 +221,5 @@ func CheckSystemDriveAndRemoveDriveLetter(path string, inputOS string) (string,
221221 //
222222 // We must return the second element of the split path, as is, without attempting to convert
223223 // it to an absolute path. We have no knowledge of the CWD; that is treated elsewhere.
224- return toSlash (filepath .Clean (parts [1 ]), inputOS ), nil
224+ return ToSlash (filepath .Clean (parts [1 ]), inputOS ), nil
225225}
0 commit comments