Skip to content

Instantly share code, notes, and snippets.

@robertgreiner
Last active October 30, 2016 19:57
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save robertgreiner/cb67e9b44799dc04e76ee4d1811dc680 to your computer and use it in GitHub Desktop.
Save robertgreiner/cb67e9b44799dc04e76ee4d1811dc680 to your computer and use it in GitHub Desktop.
Take a shortened URL and expand it to its final address
package main
import (
"fmt"
"log"
"net/http"
)
func main() {
resp, err := http.Get("http://bit.ly/2eXwN8A") //robertgreiner.com
if err != nil {
log.Fatal(err)
}
fmt.Println(resp.Request.URL.String())
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment