Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 9970e24

Browse filesBrowse files
committed
Replaced deprecated calls (from go linter)
1 parent 137c531 commit 9970e24
Copy full SHA for 9970e24

File tree

Expand file treeCollapse file tree

3 files changed

+6
-7
lines changed
Filter options
Expand file treeCollapse file tree

3 files changed

+6
-7
lines changed

‎legacy/builder/test/builder_utils_test.go

Copy file name to clipboardExpand all lines: legacy/builder/test/builder_utils_test.go
+2-2Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
package test
1717

1818
import (
19-
"io/ioutil"
19+
"os"
2020
"testing"
2121
"time"
2222

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

3434
func tempFile(t *testing.T, prefix string) *paths.Path {
35-
file, err := ioutil.TempFile("", prefix)
35+
file, err := os.CreateTemp("", prefix)
3636
file.Close()
3737
NoError(t, err)
3838
return paths.New(file.Name())

‎legacy/builder/test/helper_tools_downloader.go

Copy file name to clipboardExpand all lines: legacy/builder/test/helper_tools_downloader.go
+2-3Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,6 @@ import (
1919
"encoding/json"
2020
"fmt"
2121
"io"
22-
"io/ioutil"
2322
"net/http"
2423
"os"
2524
"os/exec"
@@ -216,7 +215,7 @@ func downloadIndex(url string) (map[string]interface{}, error) {
216215
return nil, err
217216
}
218217

219-
bytes, err := ioutil.ReadAll(res.Body)
218+
bytes, err := io.ReadAll(res.Body)
220219
if err != nil {
221220
return nil, err
222221
}
@@ -632,7 +631,7 @@ func downloadAndUnpack(url string) (*paths.Path, []os.FileInfo, error) {
632631
return nil, nil, errors.WithStack(err)
633632
}
634633

635-
bytes, err := ioutil.ReadAll(res.Body)
634+
bytes, err := io.ReadAll(res.Body)
636635
if err != nil {
637636
return nil, nil, errors.WithStack(err)
638637
}

‎legacy/builder/test/read_file_and_store_in_context_test.go

Copy file name to clipboardExpand all lines: legacy/builder/test/read_file_and_store_in_context_test.go
+2-2Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
package test
1717

1818
import (
19-
"io/ioutil"
19+
"os"
2020
"testing"
2121

2222
"github.com/arduino/arduino-cli/legacy/builder"
@@ -26,7 +26,7 @@ import (
2626
)
2727

2828
func TestReadFileAndStoreInContext(t *testing.T) {
29-
filePath, err := ioutil.TempFile("", "test")
29+
filePath, err := os.CreateTemp("", "test")
3030
NoError(t, err)
3131

3232
file := paths.New(filePath.Name())

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.