英文:
How to follow godoc links to structures in commentaries?
问题
我的godoc安装出了问题,我不确定是什么原因。
我正在进行的操作是:
godoc -http=:6060
我想浏览stdlib的文档。
一切都很好,直到我点击注释中的结构链接时出现问题。
例如,在archive/tar中,Reader
的Next
方法有一个指向filepath.IsLocal
的链接。当我尝试跟随该链接时,出现以下错误:
lstat $GOROOT/path/filepath: 没有那个文件或目录
我的环境变量是:
- GOPATH:
/Users/jon/go
- GOROOT:
/usr/local/go
我应该怎么做才能在没有这个损坏链接的情况下浏览文档?
英文:
Something is wrong with my godoc installation and I'm unsure what.
What I am doing:
godoc -http=:6060
I want to browse stdlib documentation.
It is good until I click on links to struct in comments.
For instance in archive/tar, the Reader
Next
method has a link to filepath.IsLocal
. When I try to follow that link I get the error:
lstat $GOROOT/path/filepath: no such file or directory
My environment variables are:
- GOPATH:
/Users/jon/go
- GOROOT:
/usr/local/go
What should I do to navigate the doc without this broken link ?
答案1
得分: 1
Sat 22 Apr 2023 15:38:23 BST
godoc
工具似乎存在一个问题,它生成的链接"selector expressions"指向其他包。
在func (*Certificate) CheckSignatureFrom
的文档中也存在类似的错误链接,它引用了Certificate.Verify
(位于http://localhost:6060/pkg/crypto/x509/)。
当遇到"broken"链接(http://localhost:6060/path/filepath#IsLocal)时,将URL路径前缀添加pkg/
(http://localhost:6060/pkg/path/filepath#IsLocal)。
英文:
Sat 22 Apr 2023 15:38:23 BST
There seems to be a problem with the godoc
tool producing links for "selector expressions" that refer to other packages.
A similar broken link can be found in the docs for func (*Certificate) CheckSignatureFrom
referencing Certificate.Verify
(at http://localhost:6060/pkg/crypto/x509/).
When a "broken" link is encountered (http://localhost:6060/path/filepath#IsLocal), prefix the URL.path with pkg/
(http://localhost:6060/pkg/path/filepath#IsLocal).
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论