英文:
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.
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论