Skip to content

Commit

Permalink
Replaced deprecated calls (from go linter)
Browse files Browse the repository at this point in the history
  • Loading branch information
cmaglie committed Jan 19, 2023
1 parent 137c531 commit 9970e24
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 7 deletions.
4 changes: 2 additions & 2 deletions legacy/builder/test/builder_utils_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
package test

import (
"io/ioutil"
"os"
"testing"
"time"

Expand All @@ -32,7 +32,7 @@ func sleep(t *testing.T) {
}

func tempFile(t *testing.T, prefix string) *paths.Path {
file, err := ioutil.TempFile("", prefix)
file, err := os.CreateTemp("", prefix)
file.Close()
NoError(t, err)
return paths.New(file.Name())
Expand Down
5 changes: 2 additions & 3 deletions legacy/builder/test/helper_tools_downloader.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@ import (
"encoding/json"
"fmt"
"io"
"io/ioutil"
"net/http"
"os"
"os/exec"
Expand Down Expand Up @@ -216,7 +215,7 @@ func downloadIndex(url string) (map[string]interface{}, error) {
return nil, err
}

bytes, err := ioutil.ReadAll(res.Body)
bytes, err := io.ReadAll(res.Body)
if err != nil {
return nil, err
}
Expand Down Expand Up @@ -632,7 +631,7 @@ func downloadAndUnpack(url string) (*paths.Path, []os.FileInfo, error) {
return nil, nil, errors.WithStack(err)
}

bytes, err := ioutil.ReadAll(res.Body)
bytes, err := io.ReadAll(res.Body)
if err != nil {
return nil, nil, errors.WithStack(err)
}
Expand Down
4 changes: 2 additions & 2 deletions legacy/builder/test/read_file_and_store_in_context_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
package test

import (
"io/ioutil"
"os"
"testing"

"github.com/arduino/arduino-cli/legacy/builder"
Expand All @@ -26,7 +26,7 @@ import (
)

func TestReadFileAndStoreInContext(t *testing.T) {
filePath, err := ioutil.TempFile("", "test")
filePath, err := os.CreateTemp("", "test")
NoError(t, err)

file := paths.New(filePath.Name())
Expand Down

0 comments on commit 9970e24

Please sign in to comment.