【问题标题】:For more details see: ’go help gopath’有关详细信息,请参阅:'go help gopath'
【发布时间】:2019-06-05 01:06:27
【问题描述】:

我正在学习 Go,但遇到了一些问题。

我关注

go install

但是一个错误:

no install location for directory /Users/skan/documents/study/golang/src/section1 outside GOPATH

For more details see: ’go help gopath’

所以我回到我的 .bash/profile

这是我的 .bash/profile

# added by Anaconda3 2018.12 installer
# >>> conda init >>>
# !! Contents within this block are managed by ’conda init’ !!
__conda_setup=”$(CONDA_REPORT_ERRORS=false ’/anaconda3/bin/conda’ shell.bash hook 2> /dev/null)”
if [ $? -eq 0 ]; then
\eval ”$__conda_setup”
else
if [ -f ”/anaconda3/etc/profile.d/conda.sh” ]; then
. ”/anaconda3/etc/profile.d/conda.sh”
CONDA_CHANGEPS1=false conda activate base
else
\export PATH=”/anaconda3/bin:$PATH:$GOPATH:$GOBIN”
fi
fi
unset __conda_setup
# <<< conda init <<<
export GOPATH="/Users/skan/Documetns/study/golang"
export GOBIN=$GOPATH/bin

【问题讨论】:

  • 那么当你按照指示运行go help gopath 时,你学到了什么?
  • 仅限错字。经验法则:如果有问题:至少检查 3 次拼写错误。

标签: macos go


【解决方案1】:

试试:

mkdir -p $GOPATH/bin

您看到的错误是 installation 目录不存在,因此 install 无法执行任何操作。


另外,这里有一个错字:

export GOPATH="/Users/skan/Documetns/study/golang"

所以,同样的推理,但是,试试Documents

【讨论】:

    猜你喜欢
    • 2013-09-21
    • 1970-01-01
    • 2018-06-20
    • 2017-06-30
    • 1970-01-01
    • 2018-08-13
    • 2021-07-31
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多