On the godoc site, most libraries (http://godoc.org/github.com/beego/memcache for example) link directly to the source on github. When I run the godoc tool locally, this is not the case. We also have a local godoc server for our team, and it similarly does not link to the source on github. Our code is stored on github, and is organized accordingly (ie, github.com/mycompany/packagename). Is there a way to tell the godoc tool to link to code on github, even if it's in a private repo?
Asked
Active
Viewed 2,691 times
2
-
The website http://godoc.org and the godoc tool are not the same. godoc.org is not directly powered by the godoc tool. – Volker May 15 '14 at 15:04
-
I figured the docs on the godoc site were generated with the godoc tool, and there then must be a way to compile the godoc in a way that links to github. Am I wrong in these assumptions? Are the docs on the godoc.org site some custom markup? – pyraz May 15 '14 at 19:02
-
1godoc.org and godoc the cmd are **different**, your assumtions are wrong. And no, the docs at godoc.org are not some special markup, they are retrieved by the same mechanism godoc the cmd uses. See https://groups.google.com/d/msg/golang-nuts/_rbVuzl-OqA/N_xoNaD4kAoJ – Volker May 15 '14 at 20:57
-
Also see the source code for godoc.org - https://github.com/golang/gddo - if you're curious as to its workings. – elithrar May 15 '14 at 23:47
1 Answers
3
As mentioned in the comments, godoc (Go Doc Dot Org) generates its own links to the source.
You can see that generation in gddo-server/template.go#L49-L62
SourceLink()
.

VonC
- 1,262,500
- 529
- 4,410
- 5,250