Skip to content

Commit c40e7d4

Browse files
authored
Merge pull request #35 from snebel29/remove/deprecated-outil
Remove deprecated io/ioutil functions calls
2 parents f84145c + 787e465 commit c40e7d4

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

controllers/gitrepository_watcher.go

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,6 @@ import (
2222
"crypto/sha256"
2323
"fmt"
2424
"io"
25-
"io/ioutil"
2625
"net/http"
2726
"os"
2827

@@ -56,7 +55,7 @@ func (r *GitRepositoryWatcher) Reconcile(ctx context.Context, req ctrl.Request)
5655
log.Info("New revision detected", "revision", repository.Status.Artifact.Revision)
5756

5857
// create tmp dir
59-
tmpDir, err := ioutil.TempDir("", repository.Name)
58+
tmpDir, err := os.MkdirTemp("", repository.Name)
6059
if err != nil {
6160
return ctrl.Result{}, fmt.Errorf("failed to create temp dir, error: %w", err)
6261
}
@@ -71,7 +70,7 @@ func (r *GitRepositoryWatcher) Reconcile(ctx context.Context, req ctrl.Request)
7170
log.Info(summary)
7271

7372
// list artifact content
74-
files, err := ioutil.ReadDir(tmpDir)
73+
files, err := os.ReadDir(tmpDir)
7574
if err != nil {
7675
return ctrl.Result{}, fmt.Errorf("failed to list files, error: %w", err)
7776
}

0 commit comments

Comments
 (0)