go-zero/tools/goctl/util/file_test.go
anqiansong b8ea16a88e
feat: Add --remote (#1387)
Co-authored-by: anqiansong <anqiansong@bytedance.com>
2021-12-29 18:16:42 +08:00

24 lines
348 B
Go

package util
import (
"os"
"path/filepath"
"testing"
"github.com/stretchr/testify/assert"
)
func TestGetGitHome(t *testing.T) {
homeDir, err := os.UserHomeDir()
if err != nil {
return
}
actual, err := GetGitHome()
if err != nil {
return
}
expected := filepath.Join(homeDir, goctlDir, gitDir)
assert.Equal(t, expected, actual)
}