2017-02-10 71 views
0

我尝试在我的项目文件夹/d/projects/go/src/github.com/user/dbotgovendor不从CMD

govendor init

使用govendor工作,但庆典返回

bash: govendor: command not found

安装的,我只是按照指令,并使用

go get -u github.com/kardianos/govendor 

有别的东西什么,我需要知道

$ go env 
set GOARCH=amd64 
set GOBIN= 
set GOEXE=.exe 
set GOHOSTARCH=amd64 
set GOHOSTOS=windows 
set GOOS=windows 
set GOPATH=D:\projects\go 
set GORACE= 
set GOROOT=C:\Go 
set GOTOOLDIR=C:\Go\pkg\tool\windows_amd64 
set CC=gcc 
set GOGCCFLAGS=-m64 -mthreads -fmessage-length=0 -fdebug-prefix-map=C:\Users\VLADYS~1.KOC\AppData\Local\Temp\go-build082923582=/tmp/go-build -gno-record-gcc-switches 
set CXX=g++ 
set CGO_ENABLED=1 
+1

这听起来像是一个路径问题。如果您刚刚安装,请尝试重新启动您的终端。如果该工作尝试将C:\ Go \ bin添加到您的路径中。 – KilledKenny

+0

重新启动终端并输入** C:\ Go \ bin **到我的**路径**仍然不适用于我。 – rjxby

+0

您需要将'$ GOPATH/bin'设置为'D:\ projects \ go \ bin'到您的路径中。 –

回答

2

如果你正在做的是:

go get -u github.com/kardianos/govendor 

然后,仅仅安装govendor源文件和依赖。 从go help get

The -u flag instructs get to use the network to update the named 
packages and their dependencies. By default, get uses the network 
to check out missing packages but does not use it to look for updates 
to existing packages. 

你的错误:

bash: govendor: command not found 

来自于一个事实,即govendor二进制是不是在你的PATH

为了解决这个问题,首先检查$GOPATH/bin在你PATH,然后运行

go install github.com/kardianos/govendor 

,将建立govendor$GOBIN下把(默认为$GOPATH/bin)。