diff --git a/modules/base/base.go b/modules/base/base.go
index 84cf41c8d6..3e80a436e4 100644
--- a/modules/base/base.go
+++ b/modules/base/base.go
@@ -54,3 +54,5 @@ const (
BindingBooleanTypeError string = "BooleanTypeError"
BindingFloatTypeError string = "FloatTypeError"
)
+
+var GoGetMetas = make(map[string]bool)
diff --git a/modules/base/template.go b/modules/base/template.go
index 6241497969..863bd89e81 100644
--- a/modules/base/template.go
+++ b/modules/base/template.go
@@ -197,3 +197,15 @@ func DiffLineTypeToStr(diffType int) string {
}
return "same"
}
+
+const (
+ TPL_GO_GET_META = ``
+)
+
+func GetGoGetMetaList() []byte {
+ buf := bytes.NewBuffer([]byte(""))
+ for meta := range GoGetMetas {
+ buf.WriteString(fmt.Sprintf(TPL_GO_GET_META, Domain, meta))
+ }
+ return buf.Bytes()
+}
diff --git a/routers/dashboard.go b/routers/dashboard.go
index 2c81cf23c1..12635412ad 100644
--- a/routers/dashboard.go
+++ b/routers/dashboard.go
@@ -11,6 +11,11 @@ import (
)
func Home(ctx *middleware.Context) {
+ if ctx.Query("go-get") == "1" {
+ ctx.Write(base.GetGoGetMetaList())
+ return
+ }
+
if ctx.IsSigned {
user.Dashboard(ctx)
return
diff --git a/routers/repo/repo.go b/routers/repo/repo.go
index dda26899d0..a7088d5552 100644
--- a/routers/repo/repo.go
+++ b/routers/repo/repo.go
@@ -107,6 +107,10 @@ func MigratePost(ctx *middleware.Context, form auth.MigrateRepoForm) {
}
func Single(ctx *middleware.Context, params martini.Params) {
+ if ctx.Query("go-get") == "1" {
+ base.GoGetMetas[strings.TrimSuffix(ctx.Repo.CloneLink.HTTPS, ".git")] = true
+ }
+
branchName := ctx.Repo.BranchName
userName := ctx.Repo.Owner.Name
repoName := ctx.Repo.Repository.Name
diff --git a/templates/base/head.tmpl b/templates/base/head.tmpl
index 441fd542df..1d63b46634 100644
--- a/templates/base/head.tmpl
+++ b/templates/base/head.tmpl
@@ -9,7 +9,7 @@
-
+
{{if IsProdMode}}