woo
This commit is contained in:
parent
7bb1fe712b
commit
e924a0a345
3
http/go.mod
Normal file
3
http/go.mod
Normal file
@ -0,0 +1,3 @@
|
|||||||
|
module lovelynet.net/http
|
||||||
|
|
||||||
|
go 1.17
|
||||||
19
http/main.go
Normal file
19
http/main.go
Normal 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)
|
||||||
|
}
|
||||||
Loading…
x
Reference in New Issue
Block a user