This commit is contained in:
laurentu 2023-08-11 15:17:50 +02:00
commit e7cca80808
2 changed files with 22 additions and 0 deletions

3
go.mod Normal file
View File

@ -0,0 +1,3 @@
module passke.org/hostchecker
go 1.19

19
main.go Normal file
View File

@ -0,0 +1,19 @@
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)
}
}