我通过安装了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 关注
- 309 浏览
添加回答
举报
0/150
提交
取消