replaced deprecated 'io/ioutil' with 'io'
Some checks failed
Run Integration Tests / test (push) Failing after 39s

This commit is contained in:
partisan 2025-01-11 22:06:52 +01:00
parent 851b93bed5
commit 24c7a09479
3 changed files with 26 additions and 11 deletions

View file

@ -5,7 +5,7 @@ import (
"crypto/rand"
"encoding/json"
"fmt"
"io/ioutil"
"io"
"net/http"
"time"
)
@ -65,7 +65,10 @@ func sendMessage(serverAddr string, msg Message) error {
defer resp.Body.Close()
if resp.StatusCode != http.StatusOK {
body, _ := ioutil.ReadAll(resp.Body)
body, err := io.ReadAll(resp.Body)
if err != nil {
return fmt.Errorf("failed to read response body: %v", err)
}
return fmt.Errorf("server error: %s", body)
}