Golint fixed for modules/setting (#262)
* golint fixed for modules/setting * typo fixed and renamed UNIXSOCKET to UnixSocket
This commit is contained in:
parent
0a76d260fa
commit
94da472717
38 changed files with 178 additions and 167 deletions
|
@ -152,8 +152,8 @@ func (a *Action) ShortRepoPath() string {
|
|||
|
||||
// GetRepoLink returns relative link to action repository.
|
||||
func (a *Action) GetRepoLink() string {
|
||||
if len(setting.AppSubUrl) > 0 {
|
||||
return path.Join(setting.AppSubUrl, a.GetRepoPath())
|
||||
if len(setting.AppSubURL) > 0 {
|
||||
return path.Join(setting.AppSubURL, a.GetRepoPath())
|
||||
}
|
||||
return "/" + a.GetRepoPath()
|
||||
}
|
||||
|
@ -546,7 +546,7 @@ func CommitRepoAction(opts CommitRepoActionOptions) error {
|
|||
Ref: opts.RefFullName,
|
||||
Before: opts.OldCommitID,
|
||||
After: opts.NewCommitID,
|
||||
CompareURL: setting.AppUrl + opts.Commits.CompareURL,
|
||||
CompareURL: setting.AppURL + opts.Commits.CompareURL,
|
||||
Commits: opts.Commits.ToAPIPayloadCommits(repo.HTMLURL()),
|
||||
Repo: apiRepo,
|
||||
Pusher: apiPusher,
|
||||
|
|
|
@ -317,7 +317,7 @@ func (pr *PullRequest) Merge(doer *User, baseGitRepo *git.Repository) (err error
|
|||
Ref: git.BRANCH_PREFIX + pr.BaseBranch,
|
||||
Before: pr.MergeBase,
|
||||
After: pr.MergedCommitID,
|
||||
CompareURL: setting.AppUrl + pr.BaseRepo.ComposeCompareURL(pr.MergeBase, pr.MergedCommitID),
|
||||
CompareURL: setting.AppURL + pr.BaseRepo.ComposeCompareURL(pr.MergeBase, pr.MergedCommitID),
|
||||
Commits: ListToPushCommits(l).ToAPIPayloadCommits(pr.BaseRepo.HTMLURL()),
|
||||
Repo: pr.BaseRepo.APIFormat(nil),
|
||||
Pusher: pr.HeadRepo.MustOwner().APIFormat(),
|
||||
|
|
|
@ -246,7 +246,7 @@ func (repo *Repository) FullName() string {
|
|||
}
|
||||
|
||||
func (repo *Repository) HTMLURL() string {
|
||||
return setting.AppUrl + repo.FullName()
|
||||
return setting.AppURL + repo.FullName()
|
||||
}
|
||||
|
||||
// Arguments that are allowed to be nil: permission
|
||||
|
@ -412,7 +412,7 @@ func (repo *Repository) RelLink() string {
|
|||
}
|
||||
|
||||
func (repo *Repository) Link() string {
|
||||
return setting.AppSubUrl + "/" + repo.FullName()
|
||||
return setting.AppSubURL + "/" + repo.FullName()
|
||||
}
|
||||
|
||||
func (repo *Repository) ComposeCompareURL(oldCommitID, newCommitID string) string {
|
||||
|
@ -550,7 +550,7 @@ type CloneLink struct {
|
|||
|
||||
// ComposeHTTPSCloneURL returns HTTPS clone URL based on given owner and repository name.
|
||||
func ComposeHTTPSCloneURL(owner, repo string) string {
|
||||
return fmt.Sprintf("%s%s/%s.git", setting.AppUrl, owner, repo)
|
||||
return fmt.Sprintf("%s%s/%s.git", setting.AppURL, owner, repo)
|
||||
}
|
||||
|
||||
func (repo *Repository) cloneLink(isWiki bool) *CloneLink {
|
||||
|
|
|
@ -198,14 +198,14 @@ func (u *User) CanImportLocal() bool {
|
|||
// DashboardLink returns the user dashboard page link.
|
||||
func (u *User) DashboardLink() string {
|
||||
if u.IsOrganization() {
|
||||
return setting.AppSubUrl + "/org/" + u.Name + "/dashboard/"
|
||||
return setting.AppSubURL + "/org/" + u.Name + "/dashboard/"
|
||||
}
|
||||
return setting.AppSubUrl + "/"
|
||||
return setting.AppSubURL + "/"
|
||||
}
|
||||
|
||||
// HomeLink returns the user or organization home page link.
|
||||
func (u *User) HomeLink() string {
|
||||
return setting.AppSubUrl + "/" + u.Name
|
||||
return setting.AppSubURL + "/" + u.Name
|
||||
}
|
||||
|
||||
// GenerateEmailActivateCode generates an activate code based on user information and given e-mail.
|
||||
|
@ -261,7 +261,7 @@ func (u *User) GenerateRandomAvatar() error {
|
|||
// which includes app sub-url as prefix. However, it is possible
|
||||
// to return full URL if user enables Gravatar-like service.
|
||||
func (u *User) RelAvatarLink() string {
|
||||
defaultImgUrl := setting.AppSubUrl + "/img/avatar_default.png"
|
||||
defaultImgUrl := setting.AppSubURL + "/img/avatar_default.png"
|
||||
if u.ID == -1 {
|
||||
return defaultImgUrl
|
||||
}
|
||||
|
@ -271,7 +271,7 @@ func (u *User) RelAvatarLink() string {
|
|||
if !com.IsExist(u.CustomAvatarPath()) {
|
||||
return defaultImgUrl
|
||||
}
|
||||
return setting.AppSubUrl + "/avatars/" + com.ToStr(u.ID)
|
||||
return setting.AppSubURL + "/avatars/" + com.ToStr(u.ID)
|
||||
case setting.DisableGravatar, setting.OfflineMode:
|
||||
if !com.IsExist(u.CustomAvatarPath()) {
|
||||
if err := u.GenerateRandomAvatar(); err != nil {
|
||||
|
@ -279,7 +279,7 @@ func (u *User) RelAvatarLink() string {
|
|||
}
|
||||
}
|
||||
|
||||
return setting.AppSubUrl + "/avatars/" + com.ToStr(u.ID)
|
||||
return setting.AppSubURL + "/avatars/" + com.ToStr(u.ID)
|
||||
}
|
||||
return base.AvatarLink(u.AvatarEmail)
|
||||
}
|
||||
|
@ -288,7 +288,7 @@ func (u *User) RelAvatarLink() string {
|
|||
func (u *User) AvatarLink() string {
|
||||
link := u.RelAvatarLink()
|
||||
if link[0] == '/' && link[1] != '/' {
|
||||
return setting.AppUrl + strings.TrimPrefix(link, setting.AppSubUrl)[1:]
|
||||
return setting.AppURL + strings.TrimPrefix(link, setting.AppSubURL)[1:]
|
||||
}
|
||||
return link
|
||||
}
|
||||
|
|
|
@ -142,7 +142,7 @@ func getSlackPushPayload(p *api.PushPayload, slack *SlackMeta) (*SlackPayload, e
|
|||
}
|
||||
|
||||
func getSlackPullRequestPayload(p *api.PullRequestPayload, slack *SlackMeta) (*SlackPayload, error) {
|
||||
senderLink := SlackLinkFormatter(setting.AppUrl+p.Sender.UserName, p.Sender.UserName)
|
||||
senderLink := SlackLinkFormatter(setting.AppURL+p.Sender.UserName, p.Sender.UserName)
|
||||
titleLink := SlackLinkFormatter(fmt.Sprintf("%s/pulls/%d", p.Repository.HTMLURL, p.Index),
|
||||
fmt.Sprintf("#%d %s", p.Index, p.PullRequest.Title))
|
||||
var text, title, attachmentText string
|
||||
|
@ -164,7 +164,7 @@ func getSlackPullRequestPayload(p *api.PullRequestPayload, slack *SlackMeta) (*S
|
|||
attachmentText = SlackTextFormatter(p.PullRequest.Body)
|
||||
case api.HookIssueAssigned:
|
||||
text = fmt.Sprintf("[%s] Pull request assigned to %s: %s by %s", p.Repository.FullName,
|
||||
SlackLinkFormatter(setting.AppUrl+p.PullRequest.Assignee.UserName, p.PullRequest.Assignee.UserName),
|
||||
SlackLinkFormatter(setting.AppURL+p.PullRequest.Assignee.UserName, p.PullRequest.Assignee.UserName),
|
||||
titleLink, senderLink)
|
||||
case api.HookIssueUnassigned:
|
||||
text = fmt.Sprintf("[%s] Pull request unassigned: %s by %s", p.Repository.FullName, titleLink, senderLink)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue