我通過安裝了godefgo get github.com/rogpeppe/godef我安裝了emacs go-mode,并且在.bashrc中有以下導出:export GOROOT=/usr/local/goexport GOPATH=$HOME/goexport PATH=$GOPATH/bin:$GOROOT/bin:$PATH發現godef的意義在于godef -h # appears to work.如:$ godef -husage: godef [flags] [expr] -A print all type and members information -a print public type and member information -acme use current acme window -debug debug mode -f string Go source filename -i read file from stdin -json output location in JSON format (-t flag is ignored) -o int file offset of identifier in stdin (default -1) -t print type information當我C-c C-d在emacs會話中的文件中運行時,應該在每個文件中調用一個godef-describe函數https://github.com/dominikh/go-mode.el我預計:Integration with godef godef-describe (C-c C-d) to describe expressions godef-jump (C-c C-j) and godef-jump-other-window (C-x 4 C-c C-j) to jump to declarations This requires you to install godef via go get github.com/rogpeppe/godef.酷,都準備好了。但是,當我嘗試在go文件中使用Cc Cd時,我得到:Could not run godef binary我可以在命令行上運行它,并且它的定義正確。發生了什么?我發現:M-x godoc// thengodoc: OSReadDir // for example產生godoc: /bin/bash: go: command not found這向我暗示,即使在普通的外殼程序中找到了godef和godoc,在emacs中仍可能存在一些路徑問題?如何檢查或修復?
2 回答

慕運維8079593
TA貢獻1876條經驗 獲得超5個贊
?/ .emacs.d / init.el
(setq exec-path (append exec-path '("/root/go/bin")))
- 2 回答
- 0 關注
- 343 瀏覽
添加回答
舉報
0/150
提交
取消