I was trying to implement the sync feature for my project, we all know that sync deletes the files which belongs to remote, but does not belong to source. First thing came to my mind is that, I can get a slice of full remote objects, then compare each source object (which comes from channel) with the slice and eliminate the ones which belongs to source. Then what is left in the slice are the objects to be deleted.
But this approach can take much memory and it will be slow, I care about concurrency and program to be fast. I was trying to review rclone code in github but I am not sure how rclone detects files to be deleted.
English is not my main language. Sorry for the any misunderstanding. If you can help me, I would appreciate it very much.