2022-02-10 22:06:57 +00:00
|
|
|
//go:build !solution
|
2020-02-13 19:54:24 +00:00
|
|
|
|
|
|
|
package main
|
|
|
|
|
2024-06-01 23:47:30 +00:00
|
|
|
import (
|
|
|
|
"fmt"
|
|
|
|
"io"
|
|
|
|
"log"
|
|
|
|
"net/http"
|
|
|
|
"os"
|
|
|
|
)
|
2020-02-13 19:54:24 +00:00
|
|
|
|
2024-06-01 23:47:30 +00:00
|
|
|
func main() {
|
|
|
|
urls := os.Args[1:]
|
|
|
|
for _, url := range urls {
|
|
|
|
resp, err := http.Get(url)
|
|
|
|
if err != nil {
|
2024-06-05 19:57:17 +00:00
|
|
|
log.Panic("fetch:", err)
|
2024-06-01 23:47:30 +00:00
|
|
|
}
|
|
|
|
defer resp.Body.Close()
|
|
|
|
body, err := io.ReadAll(resp.Body)
|
|
|
|
if err != nil {
|
2024-06-05 19:57:17 +00:00
|
|
|
log.Panic("fetch:", err)
|
2024-06-01 23:47:30 +00:00
|
|
|
}
|
2024-06-05 23:15:25 +00:00
|
|
|
fmt.Printf("%s", body)
|
2024-06-01 23:47:30 +00:00
|
|
|
}
|
2020-02-13 19:54:24 +00:00
|
|
|
}
|