From 76224eba02cfb97b18c724d69440b1fc999fccd6 Mon Sep 17 00:00:00 2001 From: Diego Bernardes Date: Tue, 5 Mar 2019 23:33:22 +0000 Subject: Support changing godoc instance (#38) This adds the ability to change the godoc.org instance used by Sally to link to documentation by providing a new `godoc` section in the configuration. --- handler.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'handler.go') diff --git a/handler.go b/handler.go index 4c409fb..2f32132 100644 --- a/handler.go +++ b/handler.go @@ -60,7 +60,7 @@ func (h packageHandler) Handle(w http.ResponseWriter, r *http.Request, ps httpro }{ Repo: h.pkg.Repo, CanonicalURL: canonicalURL, - GodocURL: fmt.Sprintf("https://godoc.org/%s%s", canonicalURL, ps.ByName("path")), + GodocURL: fmt.Sprintf("https://%s/%s%s", h.config.Godoc.Host, canonicalURL, ps.ByName("path")), } if err := packageTemplate.Execute(w, data); err != nil { http.Error(w, err.Error(), 500) -- cgit v1.2.3