(repo Interface, p string, args ...interface{})
| 83 | } |
| 84 | |
| 85 | func GenerateRepoURL(repo Interface, p string, args ...interface{}) string { |
| 86 | baseURL := fmt.Sprintf("%s%s/%s", ghinstance.HostPrefix(repo.RepoHost()), repo.RepoOwner(), repo.RepoName()) |
| 87 | if p != "" { |
| 88 | if path := fmt.Sprintf(p, args...); path != "" { |
| 89 | return baseURL + "/" + path |
| 90 | } |
| 91 | } |
| 92 | return baseURL |
| 93 | } |
| 94 | |
| 95 | func FormatRemoteURL(repo Interface, protocol string) string { |
| 96 | if protocol == "ssh" { |