Skip to content

Commit

Permalink
Update go-routine.go
Browse files Browse the repository at this point in the history
  • Loading branch information
whonion committed Jun 21, 2023
1 parent 5184d4f commit 4718ae7
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions go-routine.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ package main
import (
"bufio"
"fmt"
"io/ioutil"
"io"
"math/rand"
"net/http"
"net/url"
Expand All @@ -12,7 +12,9 @@ import (
"sync"
"time"
)

func main {

Check failure on line 15 in go-routine.go

View workflow job for this annotation

GitHub Actions / build

syntax error: unexpected {, expected (
processRequests()

Check failure on line 16 in go-routine.go

View workflow job for this annotation

GitHub Actions / build

syntax error: unexpected ), expected type
}

Check failure on line 17 in go-routine.go

View workflow job for this annotation

GitHub Actions / build

syntax error: unexpected } after top level declaration
func readLine(filename string) ([]string, error) {
file, err := os.Open(filename)
if err != nil {
Expand All @@ -27,7 +29,7 @@ func readLine(filename string) ([]string, error) {
}
return lines, scanner.Err()
}
func main() {
func processRequests() {
addresses, err := readLine("addresses.txt")
if err != nil {
fmt.Println("Error reading addresses:", err)
Expand Down Expand Up @@ -90,7 +92,7 @@ func main() {
}

defer resp.Body.Close()
body, err := ioutil.ReadAll(resp.Body)
body, err := io.ReadAll(resp.Body)
if err != nil {
fmt.Println("Error reading response body:", err)
return
Expand Down

0 comments on commit 4718ae7

Please sign in to comment.