Skip to content

Commit

Permalink
tools/bumper: Remove io/ioutil deprecated functions
Browse files Browse the repository at this point in the history
Signed-off-by: Ram Lavi <[email protected]>
  • Loading branch information
RamLavi committed Jan 7, 2025
1 parent 30d55f7 commit 720bc77
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 6 deletions.
3 changes: 1 addition & 2 deletions tools/bumper/cnao_repo_commands_test.go
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
package main

import (
"io/ioutil"
"os"
"path/filepath"

Expand All @@ -21,7 +20,7 @@ var _ = Describe("Testing internal git CNAO Repo", func() {
expectedTagCommitMap := make(map[string]string)

BeforeEach(func() {
tempDir, err := ioutil.TempDir("/tmp", "cnao-repo-commands-test")
tempDir, err := os.MkdirTemp("/tmp", "cnao-repo-commands-test")
Expect(err).ToNot(HaveOccurred(), "Should create temp dir for CNAO repo")

repoDir = filepath.Join(tempDir, "testOwner", "testRepo")
Expand Down
3 changes: 1 addition & 2 deletions tools/bumper/component_commands_test.go
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
package main

import (
"io/ioutil"
"os"
"path/filepath"

Expand All @@ -18,7 +17,7 @@ var _ = Describe("Testing internal git component", func() {
expectedTagCommitMap := make(map[string]string)

BeforeEach(func() {
tempDir, err := ioutil.TempDir("/tmp", "component-commands-test")
tempDir, err := os.MkdirTemp("/tmp", "component-commands-test")
Expect(err).ToNot(HaveOccurred(), "Should create temp dir for component")

repoDir = filepath.Join(tempDir, "testOwner", "testRepo")
Expand Down
3 changes: 1 addition & 2 deletions tools/bumper/git_fakes.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ package main
import (
"encoding/json"
"fmt"
"io/ioutil"
"os"
"os/exec"
"path/filepath"
Expand Down Expand Up @@ -345,7 +344,7 @@ func createCommit(w *git.Worktree, repoDir, fileName, branchName string) plumbin
w.Checkout(&git.CheckoutOptions{Branch: plumbing.NewBranchReferenceName(branchName)})

fileWithPath := filepath.Join(repoDir, fileName)
err := ioutil.WriteFile(fileWithPath, []byte(""), 0644)
err := os.WriteFile(fileWithPath, []byte(""), 0644)
Expect(err).ToNot(HaveOccurred(), fmt.Sprintf("Should succeed creating file %s", fileName))

_, err = w.Add(fileName)
Expand Down

0 comments on commit 720bc77

Please sign in to comment.