mirror of
https://github.com/zeromicro/go-zero.git
synced 2025-01-27 12:28:40 +08:00
b8ea16a88e
Co-authored-by: anqiansong <anqiansong@bytedance.com>
24 lines
348 B
Go
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)
|
|
}
|