diff --git a/internal/libraries/lint.go b/internal/libraries/lint.go index 0fde8985..c4a71675 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,12 +54,12 @@ 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) } + 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( @@ -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) }