Skip to content

Commit 43c7621

Browse files
committed
Remove deprecated ioutil usage
Signed-off-by: Chad Wilson <[email protected]>
1 parent 473b437 commit 43c7621

File tree

2 files changed

+3
-5
lines changed

2 files changed

+3
-5
lines changed

build/make.go

+1-2
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@ import (
55
"flag"
66
"fmt"
77
"io"
8-
"io/ioutil"
98
"log"
109
"os"
1110
"os/exec"
@@ -208,7 +207,7 @@ var (
208207
)
209208

210209
func getPluginProperties(jsonPropertiesFile string) (map[string]interface{}, error) {
211-
pluginPropertiesJson, err := ioutil.ReadFile(jsonPropertiesFile)
210+
pluginPropertiesJson, err := os.ReadFile(jsonPropertiesFile)
212211
if err != nil {
213212
fmt.Printf("Could not read %s: %s\n", filepath.Base(jsonPropertiesFile), err)
214213
return nil, err

gauge-java.go

+2-3
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@ import (
66
"encoding/json"
77
"fmt"
88
"io"
9-
"io/ioutil"
109
"math/rand"
1110
"os"
1211
"os/exec"
@@ -199,7 +198,7 @@ func getInstalledGaugeJavaVersion() (string, error) {
199198
if err != nil {
200199
return "", fmt.Errorf("failed to get executable path. %w", err)
201200
}
202-
j, err := ioutil.ReadFile(filepath.Join(filepath.Dir(exPath), "java.json"))
201+
j, err := os.ReadFile(filepath.Join(filepath.Dir(exPath), "java.json"))
203202
if err != nil {
204203
return "", fmt.Errorf("Unable to read java.json. %w", err)
205204
}
@@ -524,7 +523,7 @@ func build(destination string, classpath string) {
524523

525524
// Writing all java src file names to a file and using it as a @filename parameter to javac. Eg: javac -cp jar1:jar2 @sources.txt
526525
// This needs to be done because if the number of java files is too high the command length will be more than that permitted by the os.
527-
tempDir, err := ioutil.TempDir("", "gauge_temp")
526+
tempDir, err := os.MkdirTemp("", "gauge_temp")
528527
if err != nil {
529528
logMessage("error", fmt.Sprint(err.Error()))
530529
return

0 commit comments

Comments
 (0)