douan6815 2017-02-11 10:08
浏览 79
已采纳

无法在基本操作系统中设置GOPATH

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条回答 默认 最新

  • doumei9589 2017-02-11 10:33
    关注

    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.

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?