如何在golang中使用ctags?

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

How to use ctags for golang?

问题

我在代码中非常依赖ctags来在代码之间进行导航。

有人能否建议如何在Mac上使用ctags与golang。

我尝试使用gotags,但是我没有看到生成任何标签文件,并且我无法在结构定义之间进行导航。

英文:

I depend heavily upon ctags to traverse between my code.

Can anyone suggest how to use ctags with golang in Mac.

I tried using gotags, but I did not see any tag file generated and I was not able to traverse between the structure definition in vice versa.

答案1

得分: 5

你想要翻译的内容是:

gotags 对我有用:gotags -R ./* > tags

英文:

gotags work for me: gotags -R ./* > tags

答案2

得分: 3

你需要编辑 ~/.ctags 文件,以便使用 ctags 生成适用于 golang 的标签。
请查看以下链接 https://stackoverflow.com/questions/8204367/ctag-database-for-go。然后执行常规的 ctags -R 命令。

英文:

You need to edit ~/.ctags for ctags to generate tags with golang.
Check following link https://stackoverflow.com/questions/8204367/ctag-database-for-go. Then do the usual ctags -R

答案3

得分: 2

通常的 ctags -R 对我来说有效。

英文:

The usual ctags -R works for me.

答案4

得分: 2

Universal-ctags(https://ctags.io)是Exuberant-ctags的非官方分支,内置了Go解析器。它不是基于正则表达式的(即不是基于.ctags的)。

英文:

Universal-ctags (https://ctags.io), an unofficial fork of Exuberant-ctags has built-in Go parser. It is not regex based (== not .ctags based).

huangapple
  • 本文由 发表于 2016年1月22日 12:37:16
  • 转载请务必保留本文链接:https://go.coder-hub.com/34939098.html
匿名

发表评论

匿名网友

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

确定