You need to provide a credentials.json for Google Drive API. This code was generated using ChatGPT 4o, with some revision and feedback from me @purwaren.
- Go to the Google Cloud Console.
- Create a new project or select an existing project.
- Enable the Google Drive API for the project.
- Create OAuth 2.0 credentials (Client ID and Secret).
- Download the credentials.json file.
- Placing the credentials.json file:
- Place the credentials.json file in the same directory as your Go application or executable.
- Ensure the file is named credentials.json.
- Go to Google Drive.
- Navigate to the Target Folder:
- Locate and open the folder you want to use as the target for your sync.
- Get the Folder ID: Look at the URL in your browser’s address bar. It will look something like this: https://drive.google.com/drive/u/0/folders/XXXXXXXXXXXXXXXXXXXXXXXXXXX. The XXXXXXXXXXXXXXXXXXXXXXXXXXX part is the folder ID. Copy this ID.