Move RootPath to fs package

This moves the RootPath function out of the archive package and into the
fs package for external use.

Signed-off-by: Michael Crosby <crosbymichael@gmail.com>
This commit is contained in:
Michael Crosby
2017-07-26 13:34:41 -04:00
parent b84817a29c
commit c3872b848f
5 changed files with 111 additions and 118 deletions

View File

@@ -182,11 +182,11 @@ func TestBreakouts(t *testing.T) {
errFileDiff := errors.New("files differ")
sameFile := func(f1, f2 string) func(string) error {
return func(root string) error {
p1, err := rootPath(root, f1)
p1, err := fs.RootPath(root, f1)
if err != nil {
return err
}
p2, err := rootPath(root, f2)
p2, err := fs.RootPath(root, f2)
if err != nil {
return err
}
@@ -484,7 +484,7 @@ func TestApplyTar(t *testing.T) {
directoriesExist := func(dirs ...string) func(string) error {
return func(root string) error {
for _, d := range dirs {
p, err := rootPath(root, d)
p, err := fs.RootPath(root, d)
if err != nil {
return err
}