我怎样才能安装一个包装去得到? [英] How can I install a package with go get?

查看:94
本文介绍了我怎样才能安装一个包装去得到?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

  go get github.com:capotej 

我想从github安装包到我的gopath,我试过这个: /groupcache-db-experiment.git

存储库是

解决方案$ b

命令行



下载并安装软件包和依赖项



用法:

  go get [-d] [-f] [-fix] [-t] [-u ] [build flags] [packages] 

获取下载并安装由导入路径命名的包,
以及它们的依赖关系。

-d标志指示在下载软件包后停止;
是,它指示不安装软件包。



-f标志,仅在-u设置时有效,强制get -u不会验证
是否已从其导入路径隐含的源控件
存储库中检出每个包。如果
源是原始的本地分支,这可能很有用。



-fix标志指示可以在下载的$ b上运行修复工具

-t标志指示还可以下载所需的软件包到
构建指定软件包的测试。
$ b -u标志指示可以使用网络更新命名的
包及其依赖项。默认情况下,get使用网络
检查缺少的包,但不使用它来查找
现有包的更新。



获取接受构建标志来控制安装。请参阅'去帮助
build'。



检出或更新包时,查找符合本地安装的分支或标记
Go的版本。最重要的
规则是,如果本地安装运行版本go1,则获取
将搜索名为go1的分支或标记。如果没有这样的版本,
将检索最新版本的软件包。



有关指定软件包的更多信息,请参阅'go help packages'。



有关'go get'如何查找要下载的源代码的更多信息,请参阅'go
help importpath'。

例如,

  $ go get -v github.com/capotej/groupcache- db-experiment / ... 
github.com/capotej/groupcache-db-experiment(下载)
github.com/golang/groupcache(下载)
github.com/golang/protobuf (下载)
github.com/capotej/groupcache-db-experiment/api
github.com/capotej/groupcache-db-experiment/client
github.com/capotej/groupcache-db -experiment / slowdb
github.com/golang/groupcache/consistenthash
github.com/golang/protobuf/proto
github.com/golang/groupcache/lru
github.com / capotej / groupcache-db-experiment / dbserver
github.com/capotej/groupcache-db-experiment/cli
github.com/gola ng / groupcache / singleflight
github.com/golang/groupcache/groupcachepb
github.com/golang/groupcache
github.com/capotej/groupcache-db-experiment/frontend
$


I want to install packages from github to my gopath, I have tried this:

go get github.com:capotej/groupcache-db-experiment.git

the repository is here.

解决方案

Command go

Download and install packages and dependencies

Usage:

go get [-d] [-f] [-fix] [-t] [-u] [build flags] [packages]

Get downloads and installs the packages named by the import paths, along with their dependencies.

The -d flag instructs get to stop after downloading the packages; that is, it instructs get not to install the packages.

The -f flag, valid only when -u is set, forces get -u not to verify that each package has been checked out from the source control repository implied by its import path. This can be useful if the source is a local fork of the original.

The -fix flag instructs get to run the fix tool on the downloaded packages before resolving dependencies or building the code.

The -t flag instructs get to also download the packages required to build the tests for the specified packages.

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.

Get also accepts build flags to control the installation. See 'go help build'.

When checking out or updating a package, get looks for a branch or tag that matches the locally installed version of Go. The most important rule is that if the local installation is running version "go1", get searches for a branch or tag named "go1". If no such version exists it retrieves the most recent version of the package.

For more about specifying packages, see 'go help packages'.

For more about how 'go get' finds source code to download, see 'go help importpath'.

For example,

$ go get -v github.com/capotej/groupcache-db-experiment/...
github.com/capotej/groupcache-db-experiment (download)
github.com/golang/groupcache (download)
github.com/golang/protobuf (download)
github.com/capotej/groupcache-db-experiment/api
github.com/capotej/groupcache-db-experiment/client
github.com/capotej/groupcache-db-experiment/slowdb
github.com/golang/groupcache/consistenthash
github.com/golang/protobuf/proto
github.com/golang/groupcache/lru
github.com/capotej/groupcache-db-experiment/dbserver
github.com/capotej/groupcache-db-experiment/cli
github.com/golang/groupcache/singleflight
github.com/golang/groupcache/groupcachepb
github.com/golang/groupcache
github.com/capotej/groupcache-db-experiment/frontend
$ 

这篇关于我怎样才能安装一个包装去得到?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆