doutan8775
2016-05-12 04:34
浏览 141
已采纳

在GO中找不到软件包“ gopkg.in/validator.v2”错误

I am new to GO language.

When I am trying to build my GO project in windows by using

go build

, its giving an error,

api.go:7:2: cannot find package "gopkg.in/validator.v2" in any of:

C:\Go\src\gopkg.in\validator.v2 (from $GOROOT)

C:\Home\GO..\src\gopkg.in\validator.v2 (from $GOPATH)

How to add this package to my project?

When I tried to add the above package by,

go get gopkg.in\validator.v2

then its giving another error like,

go: missing Git command. See https://golang.org/s/gogetcmd package gopkg.in/validator.v2: exec: "git": executable file not found in %PATH%

图片转代码服务由CSDN问答提供 功能建议

我是GO语言的新手。

当我尝试构建时 使用

 进行构建
   
 
 

在Windows中执行我的GO项目,它给出了一个错误,

api.go:7:2:在以下任意位置都找不到软件包“ gopkg.in/validator.v2”:

C:\ Go \ src \ gopkg.in \ validator.v2(来自$ GOROOT)

C:\ Home \ GO .. \ src \ gopkg.in \ validator.v2(来自$ GOPATH)

如何将此软件包添加到我的项目中?

当我尝试通过上述方法添加以上软件包时,

 去获取gopkg.in \ validator.v2 
   
 
 

然后给出另一个错误,例如

go:缺少Git命令。 请参见 https://golang.org/s/gogetcmd 包 gopkg.in/validator.v2: exec:“ git”:在 %PATH% 中找不到可执行文件

  • 写回答
  • 好问题 提建议
  • 追加酬金
  • 关注问题
  • 邀请回答

1条回答 默认 最新

相关推荐 更多相似问题