NameEmtpyError实现了 Error() 方法的对象都可以
()
| 92 | |
| 93 | // NameEmtpyError实现了 Error() 方法的对象都可以 |
| 94 | func (e *GitRepoAccessError) Error() string { |
| 95 | if e != nil { |
| 96 | if e.GitRepoAccessStatus == GitRepoStatusEnum_NotExists { |
| 97 | return "当前 git 仓库不存在" |
| 98 | } else if e.GitRepoAccessStatus == GitRepoStatusEnum_PrivateRepository { |
| 99 | return "当前 git 仓库为私有库" |
| 100 | } else if e.GitRepoAccessStatus == GitRepoStatusEnum_Other { |
| 101 | return "当前 git 仓库不存在或者为私有库" |
| 102 | } |
| 103 | } |
| 104 | return "" |
| 105 | } |
| 106 | |
| 107 | // 检查错误 |
| 108 | func (g gitOperation) CheckError4RepositoryUrl(actualGitRepoUrl string, httpCode int) (err *GitRepoAccessError) { |
no outgoing calls
no test coverage detected