我在Mac上创建GOPATH时遇到问题

时间:2016-11-11 20:50:39

标签: bash go directory

    Andres-Air:~ iivri.andre$ echo 'export GOPATH = $HOME'>> $HOME/.profile
Andres-Air:~ iivri.andre$ source $HOME/.profile
-bash: export: `=': not a valid identifier
-bash: export: `/Users/iivri.andre': not a valid identifier
Andres-Air:~ iivri.andre$ source $HOME/.profile
-bash: export: `=': not a valid identifier
-bash: export: `/Users/iivri.andre': not a valid identifier

我正在尝试将其导出到我的环境中,但是我收到了这些错误。如何确保正确创建根目录?

1 个答案:

答案 0 :(得分:1)

应该是:

echo 'export GOPATH=$HOME' >> $HOME/.profile