In prepAndMove you have quite some repetition. I would make a map of extension to document type:
This way you can remove the duplicate code. Also your config would look cleaner (simple data vs scattered code) and could even be loaded in runtime from an external file.
Thanks for the comment! I kind of touched on that in the post. I have given myself an arbitrary time limit to get these posts up. It was looking like I may not hit it so I never went back and added it. The original plan was a map[string]string with the document folder and then the array of extensions. As it is now, the switch wouldn't be that bad if I got rid of the repetitive error code as well.
We're a place where coders share, stay up-to-date and grow their careers.
We strive for transparency and don't collect excess data.