How to follow godoc links to structures in commentaries?

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

How to follow godoc links to structures in commentaries?

问题

我的godoc安装出了问题,我不确定是什么原因。

我正在进行的操作是:
godoc -http=:6060

我想浏览stdlib的文档。

一切都很好,直到我点击注释中的结构链接时出现问题。

例如,在archive/tar中,ReaderNext方法有一个指向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).

huangapple
  • 本文由 发表于 2023年4月21日 23:11:00
  • 转载请务必保留本文链接:https://go.coder-hub.com/76074479.html
匿名

发表评论

匿名网友

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

确定