fix go get sub package and add domain on installation to let go get work defaultly (#1518)

* fix go get sub package and add domain on installation to let go get work defaultly

* fix import sequence

* fix .git problem
This commit is contained in:
Lunny Xiao 2017-04-21 10:43:29 +08:00 committed by GitHub
parent 42072783c9
commit f0db3da713
3 changed files with 27 additions and 1 deletions

View file

@ -127,7 +127,7 @@ func composeGoGetImport(owner, repo string) string {
func earlyResponseForGoGetMeta(ctx *Context) {
ctx.PlainText(200, []byte(com.Expand(`<meta name="go-import" content="{GoGetImport} git {CloneLink}">`,
map[string]string{
"GoGetImport": composeGoGetImport(ctx.Params(":username"), ctx.Params(":reponame")),
"GoGetImport": composeGoGetImport(ctx.Params(":username"), strings.TrimSuffix(ctx.Params(":reponame"), ".git")),
"CloneLink": models.ComposeHTTPSCloneURL(ctx.Params(":username"), ctx.Params(":reponame")),
})))
}