亚洲在线久爱草,狠狠天天香蕉网,天天搞日日干久草,伊人亚洲日本欧美

為了賬號安全,請及時綁定郵箱和手機立即綁定
已解決430363個問題,去搜搜看,總會有你想問的

在go-mode emacs會話中找不到Godef

在go-mode emacs會話中找不到Godef

Go
四季花海 2021-04-01 22:15:42
我通過安裝了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個贊

http://img1.sycdn.imooc.com//607d261000010dcd02490039.jpg

?/ .emacs.d / init.el

(setq exec-path (append exec-path '("/root/go/bin")))


查看完整回答
反對 回復 2021-04-19
  • 2 回答
  • 0 關注
  • 343 瀏覽
慕課專欄
更多

添加回答

舉報

0/150
提交
取消
微信客服

購課補貼
聯系客服咨詢優惠詳情

幫助反饋 APP下載

慕課網APP
您的移動學習伙伴

公眾號

掃描二維碼
關注慕課網微信公眾號