英文:
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.
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论