Commit graph

25 commits

Author SHA1 Message Date
itchyny
e81d936dd5 switch from math/rand to crypto/rand package 2023-04-09 12:25:22 +09:00
itchyny
49d37b4903 add package comment and enable all checks of staticcheck 2023-04-09 12:23:33 +09:00
itchyny
5ac7f7d75f use strconv.FormatUint with base 16 to generate temporary paths 2021-01-08 19:43:52 +09:00
itchyny
85ce23caff avoid fmt.Sprintf in error messages 2021-01-08 19:20:48 +09:00
itchyny
885b5d6aa0 report an error on failed to create a temporary path 2021-01-07 22:23:24 +09:00
itchyny
f208800bec improve comments 2021-01-07 22:12:34 +09:00
itchyny
4ce13f9e9e support directory renames (close #11)
- reject invalid renames (ex: move x x/x)
- move to a temporary path before any parent directory is moved
- rename in increasing destination directory depth order
2021-01-07 21:42:34 +09:00
itchyny
10d2c971a8 apply gofumpt 2020-08-14 01:16:58 +09:00
lunarxlark
fade350461 fix typo 2020-01-09 17:49:04 +09:00
itchyny
0ed17e263c undo the processed renames on error 2020-01-09 13:08:26 +09:00
itchyny
a4647e9205 return the stat error on failure 2020-01-09 12:07:26 +09:00
itchyny
8197e82aaa create destination directory 2020-01-08 16:39:30 +09:00
itchyny
ac672113f2 check same source path after clean 2020-01-08 11:10:27 +09:00
itchyny
1bb8c86761 add comments to the main logic 2020-01-08 10:27:20 +09:00
itchyny
e306b90e00 list all the sources to skip the cleaned sources 2020-01-08 09:23:21 +09:00
itchyny
d838f2b136 remove renames with same source and destination 2020-01-08 09:02:17 +09:00
itchyny
0926ef4faa clean source path as well to allow directory rename cycle 2020-01-08 01:21:15 +09:00
itchyny
5515f2c87a rename Move to Rename 2020-01-08 00:40:54 +09:00
itchyny
72dc9b0e83 check destination error on cleaned path 2020-01-08 00:40:54 +09:00
itchyny
0e578e6b83 return error on empty path 2020-01-08 00:40:54 +09:00
itchyny
8d8905510f return error on duplicate destination 2020-01-08 00:40:54 +09:00
itchyny
33d7af2229 implement cycle renames 2020-01-08 00:40:54 +09:00
itchyny
02f7964dc5 introduce rename struct 2020-01-08 00:40:54 +09:00
itchyny
dc16bb0051 implement simple Move function 2020-01-08 00:40:43 +09:00
itchyny
ac88fa99fe initialize repository 2020-01-08 00:40:41 +09:00