[英]govendor doesn't work from cmd
I try to use govendor in my project folder /d/projects/go/src/github.com/user/dbot
我尝试在我的项目文件夹
/d/projects/go/src/github.com/user/dbot
govendor init
州长初始化
but bash returns但 bash 返回
bash: govendor: command not found
bash:govendor:找不到命令
for installation I just follow instruction and use安装我只是按照说明使用
go get -u github.com/kardianos/govendor
there is something else about what I need to know还有一些关于我需要知道的事情
$ 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
If all you are doing is: 如果您所做的只是:
go get -u github.com/kardianos/govendor
then that just installs the govendor
source files and dependencies. 然后,只需安装
govendor
源文件和依赖项。 From go help get
: 从
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.
Your error: 你的错误:
bash: govendor: command not found
comes from the fact that the govendor
binary is not under your PATH
. 来自
govendor
二进制文件不在你的PATH
之下的事实。
To fix this, first check that $GOPATH/bin
is in your PATH
, then run 要解决此问题,首先检查
$GOPATH/bin
是否在PATH
,然后运行
go install github.com/kardianos/govendor
That will build govendor
and put under $GOBIN
(which by default is $GOPATH/bin
). 这将构建
govendor
并置于$GOBIN
(默认为$GOPATH/bin
) $GOPATH/bin
。
As @theeddieh mentioned, it's because the $GOPATH/bin
is not in the $PATH
. 正如@theeddieh所提到的,这是因为
$GOPATH/bin
不在$PATH
。
Add the following to your .bash_profile
, then restart your terminal app. 将以下内容添加到
.bash_profile
,然后重新启动终端应用程序。
export GOPATH=$HOME/go
export PATH=$PATH:$GOPATH/bin
Finally, run go get -u github.com/kardianos/govendor
to install. 最后,运行
go get -u github.com/kardianos/govendor
进行安装。 govendor
should now be available globally. govendor
现在应该可以在全球范围内使用。
$ ls -alR /data/data/com.termux/files/home/go|grep vendor
drwx------ 3 u0_a131 u0_a131 4096 Jul 30 17:02 govendor
/data/data/com.termux/files/home/go/pkg/mod/cache/download/github.com/kardianos/govendor:
/data/data/com.termux/files/home/go/pkg/mod/cache/download/github.com/kardianos/govendor/@v:
-rw------- 1 u0_a131 u0_a131 372 Jul 30 17:02 govendor@v1.0.9
dr-x------ 14 u0_a131 u0_a131 4096 Jul 30 17:02 govendor@v1.0.9
/data/data/com.termux/files/home/go/pkg/mod/github.com/kardianos/govendor@v1.0.9:
dr-x------ 2 u0_a131 u0_a131 4096 Jul 30 17:02 vendor
dr-x------ 2 u0_a131 u0_a131 4096 Jul 30 17:02 vendorfile
/data/data/com.termux/files/home/go/pkg/mod/github.com/kardianos/govendor@v1.0.9/cliprompt:
/data/data/com.termux/files/home/go/pkg/mod/github.com/kardianos/govendor@v1.0.9/context:
-r-------- 1 u0_a131 u0_a131 1691 Jul 30 17:02 vendorFile.go
/data/data/com.termux/files/home/go/pkg/mod/github.com/kardianos/govendor@v1.0.9/doc:
/data/data/com.termux/files/home/go/pkg/mod/github.com/kardianos/govendor@v1.0.9/help:
/data/data/com.termux/files/home/go/pkg/mod/github.com/kardianos/govendor@v1.0.9/internal:
/data/data/com.termux/files/home/go/pkg/mod/github.com/kardianos/govendor@v1.0.9/internal/gt:
/data/data/com.termux/files/home/go/pkg/mod/github.com/kardianos/govendor@v1.0.9/internal/pathos:
/data/data/com.termux/files/home/go/pkg/mod/github.com/kardianos/govendor@v1.0.9/internal/vfilepath:
/data/data/com.termux/files/home/go/pkg/mod/github.com/kardianos/govendor@v1.0.9/internal/vos:
/data/data/com.termux/files/home/go/pkg/mod/github.com/kardianos/govendor@v1.0.9/migrate:
/data/data/com.termux/files/home/go/pkg/mod/github.com/kardianos/govendor@v1.0.9/pkgspec:
/data/data/com.termux/files/home/go/pkg/mod/github.com/kardianos/govendor@v1.0.9/prompt:
/data/data/com.termux/files/home/go/pkg/mod/github.com/kardianos/govendor@v1.0.9/run:
/data/data/com.termux/files/home/go/pkg/mod/github.com/kardianos/govendor@v1.0.9/vcs:
/data/data/com.termux/files/home/go/pkg/mod/github.com/kardianos/govendor@v1.0.9/vendor:
-r-------- 1 u0_a131 u0_a131 1494 Jul 30 17:02 vendor.json
/data/data/com.termux/files/home/go/pkg/mod/github.com/kardianos/govendor@v1.0.9/vendorfile:
-r-------- 1 u0_a131 u0_a131 3475 Jul 30 17:02 vendor.go
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.