itzmebibin
itzmebibin

Reputation: 9439

cannot find package "gopkg.in/validator.v2" error

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%

Upvotes: 2

Views: 958

Answers (1)

Alex Pliutau
Alex Pliutau

Reputation: 21957

go get uses git or hg to fetch a package, so you have to install it. For windows you can use this link.

Upvotes: 2

Related Questions