英文:
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-L62
的 SourceLink()
中看到这个生成过程。
英文:
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()
.
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论