增加获取项目目录方法

This commit is contained in:
zhangdeman committed 2023-01-13 14:41:13 +08:00
1 parent e68b22a6e1
commit 3529f2b113
2 files changed
+14

No files matched your search

+10
View File
@@ -78,3 +78,13 @@ func (p *project) BuildPath(filePathList ...string) string {
}
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
}
+4
View File
@@ -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\\"))
}
func Test_project_GetGetProjectPath(t *testing.T) {
fmt.Println(Project.GetProjectPath())
}
Reference in new issue
Block a user
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.