在 elementary OS Loki 中无法设置 GOPATH。

huangapple go评论100阅读模式
英文:

Unable to set GOPATH in elementary os loki

问题

输入:

echo "GOPATH=/home/chawat/Programming/GoWorkspace" >> ~/.bashrc

echo "export GOPATH" >> ~/.bashrc

echo "PATH=$PATH:$GOPATH/bin" >> ~/.bashrc

source ~/.bashrc

输出:

bash: /home/chawat/.bashrc: 第171行附近有语法错误的标记`newline'

bash: /home/chawat/.bashrc: 第171行:`esacGOPATH=/home/chawat/Programming/GoWorkspace'

请帮我看看出了什么问题?

英文:

Input :

echo "GOPATH=/home/chawat/Programming/GoWorkspace" >> ~/.bashrc

echo "export GOPATH" >> ~/.bashrc

echo "PATH=$PATH:$GOPATH/bin" >> ~/.bashrc

source ~/.bashrc

Output:

bash: /home/chawat/.bashrc: line 171: syntax error near unexpected token `newline'

bash: /home/chawat/.bashrc: line 171: `esacGOPATH=/home/chawat/Programming/GoWorkspace'

plz help me whats wrong?

答案1

得分: 0

看起来在运行这些命令之前,.bashrc 文件没有以换行符结尾。在文本编辑器中查看文件的末尾,并确保 GOPATH=/home/chawat/Programming/GoWorkspace 单独占据一行。

英文:

It sounds like .bashrc was not terminated by a newline before you ran those commands. Look at the end of the file in a text editor and make sure that GOPATH=/home/chawat/Programming/GoWorkspace starts on a line of its own.

huangapple
  • 本文由 发表于 2017年2月11日 18:08:12
  • 转载请务必保留本文链接:https://go.coder-hub.com/42174635.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定