我正在尝试安装 go-sql-driver在 Windows Vista 上,但我在使用 GOPATH
时遇到问题。
我按照建议安装了 git,并将 GOPATH
添加为 Windows 中的新用户环境,路径为 C:/users/A/desktop/go
。
我在命令行中运行了 go get github.com/go-sql-driver/mysql
但它给了我这个错误:
C:\>go get github.com/go-sql-driver/mysql
go: missing Git command. See http://golang.org/s/gogetcmd
package github.com/go-sql-driver/mysql: exec: "git": executable file not found in %PATH%
当我去看看http://golang.org/s/gogetcmd它只是说下载 git。但是它已经下载到我的机器上了。
我还继续为 PATH
创建了一个新的环境变量,并将其路径设置为安装 git 的目录,但这也没有帮助。
我做错了什么?
最佳答案
从 http://git-scm.com/downloads
下载 Windows 版本的 Git。
运行下载的可执行文件,当前为 Git-1.8.3-preview20130601.exe
,它将启动 Git 安装向导以安装 Git。
检查 Git 设置选项
- 从 Windows 命令提示符运行 Git
- 按原样检查,提交 Unix 风格的行结尾
通过运行检查安装:
C:\>git --version
git version 1.8.3.msysgit.0
关于windows - 如何在 Windows 上安装 go-sql-driver,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/17517085/