|
package main
|
|
|
|
import "fmt"
|
|
import "net/http"
|
|
import "io"
|
|
|
|
func main() {
|
|
fmt.Println("staring")
|
|
|
|
resp, err := http.Head("http://example.com")
|
|
if err != nil {
|
|
fmt.Println("Failed")
|
|
} else {
|
|
_, _ = io.ReadAll(resp.Body)
|
|
resp.Body.Close()
|
|
fmt.Println("status", resp.StatusCode)
|
|
}
|
|
|
|
}
|