how to get the redirect url instead of page content in golang?
<p>I am sending a request to server but it is returning a web page. Is there a way to get the url of the web page instead?</p>

<pre><code>package main

import (
    "fmt"
    "io/ioutil"
    "net/http"
)

func main() {
    req, err := http.NewRequest("GET", "https://www.google.com", nil)
    if err != nil {
        panic(err)
    }

    client := new(http.Client)
    response, err := client.Do(req)
    if err != nil {
        panic(err)
    }
    fmt.Println(ioutil.ReadAll(response.Body))
}
</code></pre>