X-Git-Url: http://www.git.cypherpunks.ru/?a=blobdiff_plain;f=cleanup.go;fp=cleanup.go;h=bb9564cdc43285bd97472774693771bbd5feef04;hb=67e92d5a298516292bbbee1f7714708cdc0766f8;hp=a98510d1ec4d7763913310cd194484decce9ea68;hpb=634ee31ae35a2eaac517e0ffa1b7caede4b27ac5;p=goredo.git diff --git a/cleanup.go b/cleanup.go index a98510d..bb9564c 100644 --- a/cleanup.go +++ b/cleanup.go @@ -22,7 +22,6 @@ import ( "io" "log" "os" - "path" "path/filepath" "strings" ) @@ -52,10 +51,7 @@ func redoDirClean(root, what string) error { } var pth string for _, fi := range fis { - pth, err = filepath.Rel(Cwd, path.Join(root, fi.Name())) - if err != nil { - panic(err) - } + pth = cwdMustRel(root, fi.Name()) switch what { case CleanupLog: if strings.HasSuffix(fi.Name(), LogSuffix) { @@ -99,10 +95,7 @@ func cleanupWalker(root, what string) error { } var pth string for _, fi := range fis { - pth, err = filepath.Rel(Cwd, path.Join(root, fi.Name())) - if err != nil { - panic(err) - } + pth = cwdMustRel(root, fi.Name()) if fi.IsDir() { if fi.Name() == RedoDir { if what == CleanupFull {