How to make godoc link to source on github

huangapple go评论153阅读模式
英文:

How to make godoc link to source on github

问题

在godoc网站上,大多数库(例如http://godoc.org/github.com/beego/memcache)直接链接到github上的源代码。但是当我在本地运行godoc工具时,情况并非如此。我们团队还有一个本地的godoc服务器,它也不会链接到github上的源代码。我们的代码存储在github上,并按照相应的方式组织(例如,github.com/mycompany/packagename)。是否有办法告诉godoc工具链接到github上的代码,即使它在私有存储库中?

英文:

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?

答案1

得分: 3

如评论中所提到的,godoc (Go Doc Dot Org) 会生成自己的源代码链接。

你可以在 gddo-server/template.go#L49-L62SourceLink() 中看到这个生成过程。

英文:

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().

huangapple
  • 本文由 发表于 2014年5月15日 22:54:54
  • 转载请务必保留本文链接:https://go.coder-hub.com/23681849.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定