1
0
mirror of https://github.com/beego/bee.git synced 2025-06-12 04:50:40 +00:00

repair staticcheck

This commit is contained in:
yitea
2020-07-21 22:24:42 +08:00
parent cc2b2d1054
commit d9633cd9af
7 changed files with 33 additions and 47 deletions

View File

@ -206,19 +206,3 @@ func concatenateError(err error, stderr string) error {
}
return fmt.Errorf("%v: %s", err, stderr)
}
// getGitProjectName 获取项目名称
func getGitProjectName(url string) (name string, err error) {
if !strings.Contains(url, ".git") {
return "", errors.New("Project address does not contain .git")
}
fileSlice := strings.Split(url, "/")
projectName := fileSlice[len(fileSlice)-1]
if projectName == "" {
return "", errors.New("Project name does not exist")
}
nameSlice := strings.Split(projectName, ".git")
return nameSlice[0], nil
}