Skip to content

Commit

Permalink
Merge pull request #999 from iyear/fix-ioutil
Browse files Browse the repository at this point in the history
fix: change ioutil to os
  • Loading branch information
daniel-hutao authored Aug 18, 2022
2 parents 4b4d3ae + 4ad0883 commit 1237ab8
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions pkg/util/git/commit_test.go
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
package git_test

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

Expand Down Expand Up @@ -39,7 +38,7 @@ var _ = Describe("CommitInfo struct", func() {
dstPath = filepath.Join(tempDir, "dstFile")
testFile, err := os.CreateTemp(tempDir, "test")
Expect(err).Error().ShouldNot(HaveOccurred())
err = ioutil.WriteFile(testFile.Name(), fileContent, 0755)
err = os.WriteFile(testFile.Name(), fileContent, 0755)
Expect(err).Error().ShouldNot(HaveOccurred())
filePaths = []*git.GitFilePathInfo{
{
Expand Down Expand Up @@ -70,7 +69,7 @@ var _ = Describe("GenerateGitFileInfo func", func() {
tempFile, err := os.CreateTemp(tempDir, "test")
tempFileLoc = tempFile.Name()
Expect(err).Error().ShouldNot(HaveOccurred())
err = ioutil.WriteFile(tempFileLoc, testContent, 0755)
err = os.WriteFile(tempFileLoc, testContent, 0755)
Expect(err).Error().ShouldNot(HaveOccurred())
})
When("path not exist", func() {
Expand Down

0 comments on commit 1237ab8

Please sign in to comment.