chore: refactor code (#1700)
This commit is contained in:
@@ -12,7 +12,7 @@ import (
|
||||
"github.com/zeromicro/go-zero/tools/goctl/util/pathx"
|
||||
)
|
||||
|
||||
func CloneIntoGitHome(url string, branch string) (dir string, err error) {
|
||||
func CloneIntoGitHome(url, branch string) (dir string, err error) {
|
||||
gitHome, err := pathx.GetGitHome()
|
||||
if err != nil {
|
||||
return "", err
|
||||
|
||||
@@ -79,7 +79,7 @@ func TestGetGoctlHome(t *testing.T) {
|
||||
t.Run("goctl_is_file", func(t *testing.T) {
|
||||
tmpFile := filepath.Join(t.TempDir(), "a.tmp")
|
||||
backupTempFile := tmpFile + ".old"
|
||||
err := ioutil.WriteFile(tmpFile, nil, 0666)
|
||||
err := ioutil.WriteFile(tmpFile, nil, 0o666)
|
||||
if err != nil {
|
||||
return
|
||||
}
|
||||
@@ -104,5 +104,4 @@ func TestGetGoctlHome(t *testing.T) {
|
||||
assert.Nil(t, err)
|
||||
assert.Equal(t, dir, home)
|
||||
})
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user