cscope for golang

从 https://gist.github.com/bopjiang/11146574 下载, 做了修改。

cscope-go.sh

 

 1 #!/bin/bash
 2 
 3 # generate cscope index files in current directory
 4 # the generated cscope index files also include go standard packages
 5 
 6 if [ "$GOROOT" = "" ] ; then
 7 echo "GOROOT is not set"
 8 GOROOT=`go env |grep "GOROOT" |cut -d "=" -f2`
 9 GOROOT=${GOROOT#\"}
10 GOROOT=${GOROOT%\"}
11 fi
12 echo $GOROOT
13 
14 go_pkg_src=$GOROOT/pkg
15 
16 find $go_pkg_src -name "*.go" -print > cscope.files
17 find . -name "*.go" -print >> cscope.files
18 
19 if cscope -b -k; then
20         echo "Done"
21 else
22         echo "Failed"
23         exit 1
24 fi

 

也可以使用starscope

$ sudo apt-get install ruby-dev
$ sudo gem install starscope therubyracer execjs

 

 

$ cd ~/my-project
$ starscope
```

Ask it things directly:
```
$ starscope -q calls,new # Lists all callers of new
```

Export it to various existing formats for automatic integration with your editor:
```
$ starscope -e ctags
$ starscope -e cscope

转载于:https://www.cnblogs.com/shaohef/p/7358111.html

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值