This example will help you to upload files & create a folder structure in google cloud storage
Use the package manager dep to install dependencies for this project.
You can refer here to create service account key for GCP storage
cd src/gcp-storage-service
go run main.go
Output :
Upload files to GCP storage in standard (regional) bucket
2019/03/16 23:38:28 URL: https://storage.googleapis.com/smart-bucket1/2019March16/testlogo.png
2019/03/16 23:38:28 Size: 696279
2019/03/16 23:38:28 MD5: 53053354e7d0307abb9e2f9d039b59b2
- Make sure that .env file parameters are filled up correctly.
- Make sure you have correct $GOPATH, refer here how to set it.