Skip to content

Instantly share code, notes, and snippets.

View patchin's full-sized avatar

Patrick Chin patchin

View GitHub Profile
@patchin
patchin / urlshort.go
Last active June 15, 2017 20:18
Go example of working with google api url shortener.
// Follow instructions here to create credentials to access google api shortener service:
// https://developers.google.com/identity/protocols/application-default-credentials
// I set the env variable GOOGLE_APPLICATION_CREDENTIALS with the path of the json credential file.
package main
import (
"fmt"
"golang.org/x/net/context"
"golang.org/x/oauth2/google"