This commit is contained in:
Benjamyn Love 2021-10-03 11:12:14 +11:00
parent 7bb1fe712b
commit e924a0a345
3 changed files with 22 additions and 0 deletions

3
http/go.mod Normal file
View File

@ -0,0 +1,3 @@
module lovelynet.net/http
go 1.17

BIN
http/http Executable file

Binary file not shown.

19
http/main.go Normal file
View File

@ -0,0 +1,19 @@
package main
import (
"fmt"
"io"
"net/http"
"os"
)
func main() {
resp, err := http.Get("https://google.com/")
if err != nil {
fmt.Println("Error: ", err)
os.Exit(1)
}
io.Copy(os.Stdout, resp.Body)
}