Try to format your code manually by pressing Ctrl + Shift + P to open Command Palette and select Format Document. If your file is being properly formatted without any issues, it means there is something wrong in formatOnSave settings.
Choose a default formatter instead of null. like this :
"editor.defaultFormatter": "esbenp.prettier-vscode"
Uninstall other formatters one by one to see if anything causes the conflict.
Try to make it Language specific.
For better understanding refer this link : https://github.com/microsoft/vscode/issues/108447
About Git Specific:
It may be the case that you are running Git Atom. Atom is a desktop application, so may be causing problems in accessing the remote installation path.Try installing Git Repo.
Also make sure Go: Install/Update Tools are up-to-date.