GOPATH条目是相对路径,必须是绝对路径,如何解决这个问题?

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

GOPATH entry is relative must be Absolut path ,How can solve it

问题

你的错误信息是:go: GOPATH条目是相对路径,必须是绝对路径:"%Jittu%\go"。有关更多详细信息,请参阅'go help gopath'。

英文:

GOPATH条目是相对路径,必须是绝对路径,如何解决这个问题?

go: GOPATH entry is relative; must be absolute path: "%Jittu%\go".
For more details see: 'go help gopath

答案1

得分: 3

Go不会展开Windows(或其他)环境变量中的GOPATH。你需要提供绝对路径,例如setx GOPATH "C:\Users\Jittu\go"

如果你想使用其他变量来设置GOPATH,它必须在设置GOPATH时展开,这样Go才能将GOPATH始终视为绝对路径。

英文:

Go doesn't expand Windows (or any other) environmental variables in GOPATH. You need to provide absolute path, e.g. setx GOPATH "C:\Users\Jittu\go".

If you want to use other variable to set GOPATH it must be expanded at the time of setting GOPATH so that GOPATH is always seen by Go only as absolute path.

huangapple
  • 本文由 发表于 2021年7月18日 11:40:35
  • 转载请务必保留本文链接:https://go.coder-hub.com/68425823.html
匿名

发表评论

匿名网友

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

确定