The go oracle is a prototype source analysis tool that answers questions about Go programs.
エディタと統合するとJava書くときのEclipseばりの戦闘力になる。
- callees 呼ぶ関数を表示
- callers 呼び出し元を表示
- callgraph コールグラフを表示
- callstack コールスタックを表示
- descrive 定義等表示
- freevars 選択した範囲の変数の定義箇所を表示?
- implements 実装しているインターフェースを表示
- peers チャンネルの受信先/送信元を表示
- referrers 変数を参照している箇所を表示
% go get code.google.com/p/go.tools/cmd/oracle
% oracle -pos=<File>#<Start>,#<End> -format=<Format> <Mode> <Scope>
※1 <Start>
とか <End>
はbyte数
※2 Vimの使いの方はg<C-G>
で現在のカーソルまでのファイルのバイト数がわかる
oracle -pos=./main.go:#267 callees main.go
oracle -pos=./main.go:#267,#280 callgraph main.go
GoImplements(実装されているインターフェースを表示)だけ使えるようになっている。
他のも使えたが、一旦外されたっぽい。
微妙かも・・・
2013/08時点では唯一使えるエディタだった模様。
- https://docs.google.com/a/cyberagent.co.jp/document/d/1SLk36YRjjMgKqe490mSRzOPYEDe0Y_WQNRv-EiFYUyw/view#heading=h.al4fto2r6wvs
- http://tleyden.github.io/blog/2014/05/27/configure-emacs-as-a-go-editor-from-scratch-part-2/
統合予定だがまだっぽい。