Please consider this small Go question.
package main
import (
"fmt"
"net/http"
"time"
)
func main() {
timeout, _ := time.ParseDuration("30s")
client := http.Client{
Timeout: timeout,
}
url := "https://status.azure.com"
req, err := http.NewRequest("GET", url, nil)
checkErr(err)
fmt.Println("Status", response.StatusCode)
}
func checkErr(err error) {
if err != nil {
fmt.Println("Got error", err)
}
}
I've inherited something similar, and need to route this https GET request to a specific IPV4 address.
I've read this, but cannot get to work with the semantics in here, a bit confused, and I am not making the connection. Is there a simpler way to achieve this? thanks!