为什么Glide要求设置GOPATH?

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

Why does glide expect GOPATH to be set?

问题

我正在尝试在OS X上为一个项目安装依赖项,其中涉及调用glide up命令。然而,glide一直以以下错误失败:[ERROR] $GOPATH is not set.。我正在使用glide版本0.12.3和go版本1.8.1。

为什么glide要求设置GOPATH

我对go和glide都不太熟悉,但据我所知,定义$GOPATH应该是可选的。

英文:

I'm trying to install the dependencies for a project (on OS X), which involves calling glide up. However, glide fails consistently with the following error: [ERROR] $GOPATH is not set.. I'm using glide version 0.12.3 and go version 1.8.1.

Why does glide require GOPATH to be set?

I'm new to go and glide, but from what I can tell defining $GOPATH should be optional.

答案1

得分: 2

为什么Glide要求设置GOPATH?

因为在Go 1.8之前,GOPATH是必需的,而Glide在1.8之前就存在了。Glide在25天前进行了更新以处理这个变化,但最近的发布版本(0.12.13,你正在使用的版本)是在2016年10月发布的

英文:

> Why does glide require GOPATH to be set?

Because GOPATH wasn't optional until Go 1.8 and glide existed before 1.8. Glide was updated 25 days ago to handle this change, but the most recent release (0.12.13 and what you're using) was released in October of 2016

答案2

得分: 0

我对glide不是很熟悉,但是GOPATH是go使用的一个变量,用于定义你的工作区在哪里。

从Go 1.8.1开始,GOPATH默认为用户主目录下的go子目录。这是相关的提交 https://github.com/golang/go/commit/74628a8b9f102bddd5078ee426efe0fd57033115

如果你使用的是Go 1.8.1以下的版本,则需要设置GOPATH。

此外,glide似乎不对GOPATH做任何假设,但它与Go 1.8.1的默认设置相容。

英文:

I'm not very familiar with glide but GOPATH is a variable used by go to define where your workspace is.

As of Go 1.8.1, GOPATH defaults to a go subdirectory in your user's home directory. Here's the relevant commit https://github.com/golang/go/commit/74628a8b9f102bddd5078ee426efe0fd57033115

If you're using anything below Go 1.8.1 then your GOPATH is required to be set.

Also, glide doesn't seem to make any assumptions about GOPATH but it plays nicely with Go's 1.8.1 default.

huangapple
  • 本文由 发表于 2017年5月6日 08:54:50
  • 转载请务必保留本文链接:https://go.coder-hub.com/43815605.html
匿名

发表评论

匿名网友

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

确定