Skip to content

Latest commit

 

History

History
28 lines (20 loc) · 946 Bytes

README.md

File metadata and controls

28 lines (20 loc) · 946 Bytes

Upload file to Google Cloud Storage using GOLANG

This example will help you to upload files & create a folder structure in google cloud storage

Installation

Use the package manager dep to install dependencies for this project.

You can refer here to create service account key for GCP storage

Usage

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

notes

  1. Make sure that .env file parameters are filled up correctly.
  2. Make sure you have correct $GOPATH, refer here how to set it.