将GOPATH(或任何环境变量)放在Windows的独立驱动器上。

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

Putting GOPATH (or any environment variable) on a separate drive in Windows

问题

我有一个用于非可执行文件的驱动器,并且我将%GOPATH%设置为指向该驱动器上的一个目录(D:\go\path)。然而,我无法直接从C:\驱动器输入以下命令导航到该目录:

cd %GOPATH%

我需要输入以下命令:

cd /c d:\go\path

那么,Go语言的链接器/编译器/汇编器/其他工具是否仍然能够正常工作?

英文:

I have a drive that I use for non-executable stuff, and I set %GOPATH% to point to a directory on that drive (D:\go\path). However, I can't simply type

cd %GOPATH% 

from the C:\ drive and navigate there. I need to type

cd /c d:\go\path 

Will the go linker/compiler/assembler/other stuff still function the same way?

答案1

得分: 2

这种命令行行为完全是cd命令的问题。如果你将整个gopath字符串写出来,你会得到完全相同的行为。由于go在处理路径时必须自行进行驱动器/文件夹的区分,所以一切都会正常工作。

英文:

This behavior on the command line is solely cd's fault. If you would write out the whole gopath string, you would get exactly the same behaviour. As go does (have to) make the drive/folder distinction on it's own while processing the path, everything will work just fine.

huangapple
  • 本文由 发表于 2015年10月26日 11:13:42
  • 转载请务必保留本文链接:https://go.coder-hub.com/33337943.html
匿名

发表评论

匿名网友

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

确定