Cygwin使用环境变量的相对和绝对路径

The*_*eer 8 git cygwin go

当我在Cygwin中使用以下命令时:

$ go get github.com/gorilla/mux
Run Code Online (Sandbox Code Playgroud)

我收到以下错误:

# cd .; git clone https://github.com/gorilla/mux C:\cygwin64\home\USER\Go\src\github.com\gorilla\mux
Cloning into 'C:\cygwin64\home\USER\Go\src\github.com\gorilla\mux'...
fatal: Invalid path '/home/USER/C:\cygwin64\home\USER\Go\src\github.com\gorilla\mux': No such file or directory
package github.com/gorilla/mux: exit status 128
Run Code Online (Sandbox Code Playgroud)

当我使用命令时:

cd $GOPATH
Run Code Online (Sandbox Code Playgroud)

正确的文件夹打开.

有谁可以解决这个问题?

小智 0

我认为如果你在本地和 cygwin 中都安装了 git,就会出现这种情况。对我来说,它有助于go get在 git cmd 中运行命令