Replaced Fatal with Panic in urlfetch
This commit is contained in:
parent
6e6c742228
commit
e0ed0a4cde
1 changed files with 2 additions and 2 deletions
|
@ -15,12 +15,12 @@ func main() {
|
|||
for _, url := range urls {
|
||||
resp, err := http.Get(url)
|
||||
if err != nil {
|
||||
log.Fatal("fetch:", err)
|
||||
log.Panic("fetch:", err)
|
||||
}
|
||||
defer resp.Body.Close()
|
||||
body, err := io.ReadAll(resp.Body)
|
||||
if err != nil {
|
||||
log.Fatal("fetch:", err)
|
||||
log.Panic("fetch:", err)
|
||||
}
|
||||
fmt.Println(string(body))
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue