diff --git a/cmd/test/main.go b/cmd/test/main.go index 66b06525b..034c24dc7 100644 --- a/cmd/test/main.go +++ b/cmd/test/main.go @@ -3,7 +3,6 @@ package test import ( "fmt" "io" - "io/ioutil" "os" "path/filepath" "reflect" @@ -495,7 +494,7 @@ func test(ctx *TestCommandContext, paths []string, testCommandData *TestCommandD return err } - err = ioutil.WriteFile(testCommandData.SaveResults, []byte(resultsText), 0666) + err = os.WriteFile(testCommandData.SaveResults, []byte(resultsText), 0666) if err != nil { return err } @@ -705,7 +704,7 @@ func saveDefaultRulesAsFile(ctx *TestCommandContext, preRunDefaultRulesYaml stri defaultRulesFilePath := filepath.Join(homeDir, ".datree", "defaultRules.yaml") const fileReadPermission = 0644 - _ = ioutil.WriteFile(defaultRulesFilePath, []byte(preRunDefaultRulesYaml), os.FileMode(fileReadPermission)) + _ = os.WriteFile(defaultRulesFilePath, []byte(preRunDefaultRulesYaml), os.FileMode(fileReadPermission)) } func shouldDisplaySpinner(IsCI bool, isInteractiveMode bool, outputOption string) bool { diff --git a/pkg/defaultRules/defaultRules.go b/pkg/defaultRules/defaultRules.go index 18f1c51e8..47f828b70 100644 --- a/pkg/defaultRules/defaultRules.go +++ b/pkg/defaultRules/defaultRules.go @@ -2,7 +2,6 @@ package defaultRules import ( _ "embed" - "io/ioutil" "os" "path/filepath" @@ -51,6 +50,6 @@ func getDefaultRulesFromFile() (string, error) { if err != nil { return "", err } - defaultRulesFileContent, err := ioutil.ReadFile(filepath.Join(homeDir, ".datree", "defaultRules.yaml")) + defaultRulesFileContent, err := os.ReadFile(filepath.Join(homeDir, ".datree", "defaultRules.yaml")) return string(defaultRulesFileContent), err }