From faf2954a14d244f17471f716e2106730112a5fb0 Mon Sep 17 00:00:00 2001 From: Cristian Maglie Date: Thu, 12 Dec 2024 13:07:47 +0100 Subject: [PATCH 1/2] Removed deprecated package --- internal/libraries/lint.go | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/internal/libraries/lint.go b/internal/libraries/lint.go index 0fde8985..2788c002 100644 --- a/internal/libraries/lint.go +++ b/internal/libraries/lint.go @@ -26,7 +26,6 @@ package libraries import ( "encoding/json" "fmt" - "io/ioutil" "os" "os/exec" "path/filepath" @@ -55,7 +54,7 @@ func RunArduinoLint(arduinoLintPath string, folder string, metadata *Repo) ([]by arduinoLintPath = "arduino-lint" } - JSONReportFolder, err := ioutil.TempDir("", "arduino-lint-report-") + JSONReportFolder, err := os.MkdirTemp("", "arduino-lint-report-") if err != nil { panic(err) } @@ -82,7 +81,7 @@ func RunArduinoLint(arduinoLintPath string, folder string, metadata *Repo) ([]by } // Read report. - rawJSONReport, err := ioutil.ReadFile(JSONReportPath) + rawJSONReport, err := os.ReadFile(JSONReportPath) if err != nil { panic(err) } From 83294b32276535e62bef429756469def451c1a3b Mon Sep 17 00:00:00 2001 From: Cristian Maglie Date: Thu, 12 Dec 2024 13:08:06 +0100 Subject: [PATCH 2/2] Fix arduino-lint report cleanup --- internal/libraries/lint.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/internal/libraries/lint.go b/internal/libraries/lint.go index 2788c002..c4a71675 100644 --- a/internal/libraries/lint.go +++ b/internal/libraries/lint.go @@ -58,8 +58,8 @@ func RunArduinoLint(arduinoLintPath string, folder string, metadata *Repo) ([]by if err != nil { panic(err) } + defer os.RemoveAll(JSONReportFolder) JSONReportPath := filepath.Join(JSONReportFolder, "report.json") - defer os.RemoveAll(JSONReportPath) // See: https://arduino.github.io/arduino-lint/latest/commands/arduino-lint/ cmd := exec.Command(