title: How to redirect URL in Go main method?
body: <p>I have a GorrilaMux set up in Go that will make an API call if type in a specific URL in a browser. I want to make the same API call in my main method in go if the URL is given as a command line argument. However, the http.redirect() method which seems to be able to do this, requires a HTTP ResponseWriter and a *HTTPRequest variables as function parameters. I do not know how to produce these variables within a main method. How do I do this, OR, is there a better way to make the API call from the URL in Golang?</p>
  
  <p>Code to set up Router</p>
  
  <pre><code>func main(){
     router := mux.NewRouter().StrictSlash(true)
     for _, route := range routes { //Sets up predefined routes
       router.
          Path(route.Path).
          Name(route.Name).
          Handler(route.HandlerFunc)
      }
  
    URL:="localhost:8080/whatever" //URL I want to redirect, route would be "/whatever"
  
   http.redirect(????)
  
   }
  </code></pre>