commit e7cca808080c127b0df48f30440925b76cf079e3 Author: laurentu Date: Fri Aug 11 15:17:50 2023 +0200 First diff --git a/go.mod b/go.mod new file mode 100644 index 0000000..f1c9a88 --- /dev/null +++ b/go.mod @@ -0,0 +1,3 @@ +module passke.org/hostchecker + +go 1.19 diff --git a/main.go b/main.go new file mode 100644 index 0000000..83678ed --- /dev/null +++ b/main.go @@ -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) + } + +}