增加获取项目目录方法
This commit is contained in:
parent
e68b22a6e1
commit
3529f2b113
10
project.go
10
project.go
@ -78,3 +78,13 @@ func (p *project) BuildPath(filePathList ...string) string {
|
|||||||
}
|
}
|
||||||
return strings.Join(filePathList, p.GetFileSystemSeparator())
|
return strings.Join(filePathList, p.GetFileSystemSeparator())
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// GetProjectPath 获取项目目录
|
||||||
|
//
|
||||||
|
// Author : go_developer@163.com<白茶清欢>
|
||||||
|
//
|
||||||
|
// Date : 14:39 2023/1/13
|
||||||
|
func (p *project) GetProjectPath() string {
|
||||||
|
dir, _ := os.Getwd()
|
||||||
|
return dir
|
||||||
|
}
|
||||||
|
@ -21,3 +21,7 @@ func Test_project_BuildPath(t *testing.T) {
|
|||||||
fmt.Println(Project.BuildPath("a", "b", "c"))
|
fmt.Println(Project.BuildPath("a", "b", "c"))
|
||||||
fmt.Println(Project.BuildPath("\\a\\", "\\b\\", "\\c\\"))
|
fmt.Println(Project.BuildPath("\\a\\", "\\b\\", "\\c\\"))
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func Test_project_GetGetProjectPath(t *testing.T) {
|
||||||
|
fmt.Println(Project.GetProjectPath())
|
||||||
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user