And the stats struct would just have a cute currentlyUploading map[string]struct{}
Adding one is stats.currentlyUploading[path] = struct{}{} and deleting one is delete(stats.currentlyUploading, path)
This is important because there are multiple upload threads and the current approach would incorrectly leave it on a small file even when a much larger one is in progress, making it misleading.
(then of course you would print out every key in the map, since those are all files that are uploading)
Actually I forgot that the Stats struct with a mutex existed. In that case, I think there's a cooler way to do it:
And the stats struct would just have a cute
currentlyUploading map[string]struct{}
Adding one is
stats.currentlyUploading[path] = struct{}{}
and deleting one isdelete(stats.currentlyUploading, path)
This is important because there are multiple upload threads and the current approach would incorrectly leave it on a small file even when a much larger one is in progress, making it misleading.
(then of course you would print out every key in the map, since those are all files that are uploading)