Skip to content

Instantly share code, notes, and snippets.

@arivictor
Created August 7, 2023 00:37
Show Gist options
  • Select an option

  • Save arivictor/969edb8c7a1d2c5aa4f40d79d4f42a4c to your computer and use it in GitHub Desktop.

Select an option

Save arivictor/969edb8c7a1d2c5aa4f40d79d4f42a4c to your computer and use it in GitHub Desktop.
package main
import "cloud.google.com/go/storage"
func main() {
// Hardcoded credentials
credsJSON := `{
"type": "service_account",
"project_id": "my_project",
// ... other credentials ...
}`
client, err := storage.NewClient(ctx, option.WithCredentialsJSON([]byte(credsJSON)))
// ... other logic ...
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment