使用Go语言遇到的一些坑

  1. 使用fish过程中,由于PATH被自己改变了,然后一直永不了go或ls等命令

提示如下


找不到ls

找不到go
mac@macs-MacBook-Pro /p/etc> bee new hello
2018/04/05 11:13:27 FATAL    ▶ 0001 There was an error running 'go version' command: exec: "go": executable file not found in $PATH
mac@macs-MacBook-Pro /p/etc> go version
fish: Unknown command 'go'


fish: Unknown command 'ls'
/usr/local/Cellar/fish/2.7.1/share/fish/functions/ls.fish (line 1):
command ls -G $argv
        ^
in function 'ls'
    called on standard input

修改PATH的路径

go的路径根据自己安装时候的设置,不知道就go evn试试
  export GOPATH=/usr/local/Cellar/go/1.9.2
  export GOBIN=$GOPATH/bin
  export PATH=$PATH:$GOBIN

//这个是设置把别的bin也录入!
export PATH=$PATH:$GOBIN:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin


你可能感兴趣的:(使用Go语言遇到的一些坑)