aboutsummaryrefslogtreecommitdiff
path: root/handler.go
diff options
context:
space:
mode:
authorGravatar Diego Bernardes <diego.bernardes@outlook.com> 2019-03-05 23:33:22 +0000
committerGravatar Abhinav Gupta <mail@abhinavg.net> 2019-03-05 15:33:22 -0800
commit76224eba02cfb97b18c724d69440b1fc999fccd6 (patch)
treec3d3140dcb40ebb197827df4a5132e32e918b9e1 /handler.go
parente598b4a5dcbe7abf1815677cf0bf6a7983df7cc0 (diff)
downloadsally-76224eba02cfb97b18c724d69440b1fc999fccd6.tar.gz
sally-76224eba02cfb97b18c724d69440b1fc999fccd6.tar.zst
sally-76224eba02cfb97b18c724d69440b1fc999fccd6.zip
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.
Diffstat (limited to 'handler.go')
-rw-r--r--handler.go2
1 files changed, 1 insertions, 1 deletions
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)