简体   繁体   English

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

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

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 ). 我有一个用于非可执行文件的驱动器,并且将%GOPATH%设置为指向该驱动器上的目录( D:\\go\\path )。 However, I can't simply type 但是,我不能简单地输入

cd %GOPATH% 

from the C:\\ drive and navigate there. 从C:\\驱动器中导航。 I need to type 我需要输入

cd /c d:\go\path 

Will the go linker/compiler/assembler/other stuff still function the same way? go链接器/编译器/汇编器/其他东西仍然会以相同的方式起作用吗?

This behavior on the command line is solely cd's fault. 命令行上的这种行为完全是cd的错误。 If you would write out the whole gopath string, you would get exactly the same behaviour. 如果您写出整个gopath字符串,您将获得完全相同的行为。 As go does (have to) make the drive/folder distinction on it's own while processing the path, everything will work just fine. 正如go(必须)在处理路径时自行区分驱动器/文件夹一样,一切都会正常进行。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM