Skip to content

Commit 211e8c9

Browse files
authored
Use path/filepath instead of path (#82)
Co-authored-by: hiroebe <hiroebe41@gmail.com>
1 parent cbf197b commit 211e8c9

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

conn/command_test.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ package conn
22

33
import (
44
"os"
5-
"path"
5+
"path/filepath"
66
"testing"
77

88
"github.com/stretchr/testify/assert"
@@ -88,8 +88,8 @@ func setGitDir(repoName string, t *testing.T) {
8888
gitDirOrg := os.Getenv("GIT_DIR")
8989
gitWorkTreeOrg := os.Getenv("GIT_WORK_TREE")
9090

91-
os.Setenv("GIT_DIR", path.Join(fixturePath, repoName, ".git"))
92-
os.Setenv("GIT_WORK_TREE", path.Join(fixturePath, repoName))
91+
os.Setenv("GIT_DIR", filepath.Join(fixturePath, repoName, ".git"))
92+
os.Setenv("GIT_WORK_TREE", filepath.Join(fixturePath, repoName))
9393

9494
t.Cleanup(func() {
9595
os.Setenv("GIT_DIR", gitDirOrg)

conn/stub.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
package conn
22

33
import (
4-
"io/ioutil"
5-
"path"
4+
"os"
5+
"path/filepath"
66
"runtime"
77

88
"github.com/golang/mock/gomock"
@@ -227,7 +227,7 @@ func (s *Stub) readFile(command string, category string, name string) string {
227227
if command == "gh" {
228228
ext = ".json"
229229
}
230-
b, err := ioutil.ReadFile(path.Join(filename, "..", fixturePath, command, category+"_"+name+ext))
230+
b, err := os.ReadFile(filepath.Join(filename, "..", fixturePath, command, category+"_"+name+ext))
231231
if err != nil {
232232
s.t.Fatalf("%v", err)
233233
}

0 commit comments

Comments
 (0)