MCPcopy Create free account
hub / github.com/gogs/gogs / MakeURL

Method MakeURL

internal/context/repo.go:95–108  ·  view source on GitHub ↗

MakeURL accepts a string or url.URL as argument and returns escaped URL prepended with repository URL.

(location any)

Source from the content-addressed store, hash-verified

93
94// MakeURL accepts a string or url.URL as argument and returns escaped URL prepended with repository URL.
95func (r *Repository) MakeURL(location any) string {
96 switch location := location.(type) {
97 case string:
98 tempURL := url.URL{
99 Path: r.RepoLink + "/" + location,
100 }
101 return tempURL.String()
102 case url.URL:
103 location.Path = r.RepoLink + "/" + location.Path
104 return location.String()
105 default:
106 panic("location type must be either string or url.URL")
107 }
108}
109
110// PullRequestURL returns URL for composing a pull request.
111// This function does not check if the repository can actually compose a pull request.

Callers 11

NewIssuePostFunction · 0.80
viewIssueFunction · 0.80
NewCommentFunction · 0.80
InitializeLabelsFunction · 0.80
NewLabelFunction · 0.80
UpdateLabelFunction · 0.80
DeleteLabelFunction · 0.80
NewMilestonePostFunction · 0.80
EditMilestonePostFunction · 0.80
ChangeMilestonStatusFunction · 0.80
DeleteMilestoneFunction · 0.80

Implementers 2

Repositoryinternal/database/repo.go
mailerRepointernal/database/issue_mail.go

Calls 1

StringMethod · 0.45

Tested by

no test coverage detected