Skip to content

Commit

Permalink
Fix deepsource errors
Browse files Browse the repository at this point in the history
  • Loading branch information
dhfherna committed Oct 31, 2023
1 parent 858d4fe commit 37b6e89
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions realistic_word.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ package faker
import (
"encoding/json"
"fmt"
"io/ioutil"
"io"
"math/rand"
"net/http"
"strings"
Expand All @@ -29,7 +29,7 @@ var consultService = func(context string, max int, w *[]WordInfo) {
}
defer resData.Body.Close()

bodyRes, err := ioutil.ReadAll(resData.Body)
bodyRes, err := io.ReadAll(resData.Body)
if err != nil {
fmt.Println("Error reading response data:", err)
return
Expand All @@ -54,8 +54,8 @@ func getWords(context string) []string {
}

func getRandomIndex(max int) int {
rand.Seed(time.Now().UnixNano())
return rand.Intn(max + 1)
randGen := rand.New(rand.NewSource(time.Now().UnixNano()))
return randGen.Intn(max + 1)
}

func getWord(context string) string {
Expand Down

0 comments on commit 37b6e89

Please sign in to comment.