From f208800bec7ca92af5547be9cdd488cc71255446 Mon Sep 17 00:00:00 2001 From: itchyny Date: Thu, 7 Jan 2021 22:12:34 +0900 Subject: [PATCH] improve comments --- mmv.go | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/mmv.go b/mmv.go index ac52403..70feb75 100644 --- a/mmv.go +++ b/mmv.go @@ -120,7 +120,7 @@ func buildRenames(files map[string]string) ([]rename, error) { revs[dst] = src } - // group directories by directory depth + // group paths by directory depth srcdepths := make([][]string, 1) dstdepths := make([][]string, 1) for src, dst := range files { @@ -171,7 +171,7 @@ func buildRenames(files map[string]string) ([]rename, error) { } } } - // remove source == destination + // remove if source path is equal to destination path if dst := files[src]; src == dst { delete(files, src) delete(revs, dst) @@ -233,6 +233,7 @@ func buildRenames(files map[string]string) ([]rename, error) { return rs, nil } +// create a temporary path where there is no file currently func randomPath(dir string) string { for { path := filepath.Join(dir, fmt.Sprint(rand.Uint64()))