增加获取家目录方法
This commit is contained in:
12
project.go
12
project.go
@@ -12,6 +12,8 @@ import (
|
||||
"path/filepath"
|
||||
"runtime"
|
||||
"strings"
|
||||
|
||||
"github.com/mitchellh/go-homedir"
|
||||
)
|
||||
|
||||
type project struct {
|
||||
@@ -88,3 +90,13 @@ func (p *project) GetProjectPath() string {
|
||||
dir, _ := os.Getwd()
|
||||
return dir
|
||||
}
|
||||
|
||||
// GetHomeDir 获取家目录
|
||||
//
|
||||
// Author : go_developer@163.com<白茶清欢>
|
||||
//
|
||||
// Date : 22:31 2023/4/18
|
||||
func (p *project) GetHomeDir() string {
|
||||
homePath, _ := homedir.Dir()
|
||||
return homePath
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user