diff --git a/http-get/go.mod b/http-get/go.mod new file mode 100644 index 0000000..972c9ae --- /dev/null +++ b/http-get/go.mod @@ -0,0 +1,3 @@ +module http-get + +go 1.22.1 diff --git a/http-get/main.go b/http-get/main.go new file mode 100644 index 0000000..1800e64 --- /dev/null +++ b/http-get/main.go @@ -0,0 +1,27 @@ +package main + +import ( + "fmt" + //"net" + "net/http" + "os" +) + +func main() { + if len(os.Args) != 2 { + fmt.Println("Usage: ./http-get http://bulgariu.xyz") + os.Exit(0) + } + request, err := http.Get(os.Args[1]) + fmt.Println(os.Args[1]) + if err != nil { + fmt.Println(err) + os.Exit(2) + } + fmt.Println(request) + +} + +// func handleConn(conn net.Conn) { +// +// }