Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions go/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ package main
import (
"encoding/json"
"fmt"
"io/ioutil"
"io"
"log"
"net/http"
"os"
Expand Down Expand Up @@ -80,7 +80,7 @@ func (client *GitHubClient) FetchContributors(owner, repo string) ([]GitHubUser,
return nil, fmt.Errorf("API request failed with status: %d", resp.StatusCode)
}

body, err := ioutil.ReadAll(resp.Body)
body, err := io.ReadAll(resp.Body)
if err != nil {
return nil, fmt.Errorf("reading response: %w", err)
}
Expand Down Expand Up @@ -116,7 +116,7 @@ func (client *GitHubClient) FetchPullRequests(owner, repo string) ([]PullRequest
return nil, fmt.Errorf("API request failed with status: %d", resp.StatusCode)
}

body, err := ioutil.ReadAll(resp.Body)
body, err := io.ReadAll(resp.Body)
if err != nil {
return nil, fmt.Errorf("reading response: %w", err)
}
Expand Down Expand Up @@ -183,7 +183,7 @@ func SaveStatsToFile(stats *HacktoberfestStats, filename string) error {
return fmt.Errorf("marshaling stats: %w", err)
}

if err := ioutil.WriteFile(filename, data, 0644); err != nil {
if err := os.WriteFile(filename, data, 0644); err != nil {
return fmt.Errorf("writing file: %w", err)
}

Expand Down