Last active
October 30, 2016 19:57
-
-
Save robertgreiner/cb67e9b44799dc04e76ee4d1811dc680 to your computer and use it in GitHub Desktop.
Take a shortened URL and expand it to its final address
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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