douju6752 2015-05-18 04:32
浏览 305
已采纳

如何使用go get安装软件包?

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.

  • 写回答

2条回答 默认 最新

  • duanpang1987 2015-05-18 05:59
    关注

    Command go

    Download and install packages and dependencies

    Usage:

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

    Get downloads the packages named by the import paths, along with their dependencies. It then installs the named packages, like 'go install'.

    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 -insecure flag permits fetching from repositories and resolving custom domains using insecure schemes such as HTTP. Use with caution.

    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.

    The -v flag enables verbose progress and debug output.

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

    When checking out a new package, get creates the target directory GOPATH/src/. If the GOPATH contains multiple entries, get uses the first one. For more details see: 'go help gopath'.

    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 default branch of the package.

    When go get checks out or updates a Git repository, it also updates any git submodules referenced by the repository.

    Get never checks out or updates code stored in vendor directories.

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

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

    This text describes the behavior of get when using GOPATH to manage source code and dependencies. If instead the go command is running in module-aware mode, the details of get's flags and effects change, as does 'go help get'. See 'go help modules' and 'go help module-get'.

    See also: go build, go install, go clean.


    For example, showing verbose output,

    $ 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
    $ 
    
    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论
查看更多回答(1条)

报告相同问题?

悬赏问题

  • ¥15 乌班图ip地址配置及远程SSH
  • ¥15 怎么让点阵屏显示静态爱心,用keiluVision5写出让点阵屏显示静态爱心的代码,越快越好
  • ¥15 PSPICE制作一个加法器
  • ¥15 javaweb项目无法正常跳转
  • ¥15 VMBox虚拟机无法访问
  • ¥15 skd显示找不到头文件
  • ¥15 机器视觉中图片中长度与真实长度的关系
  • ¥15 fastreport table 怎么只让每页的最下面和最顶部有横线
  • ¥15 java 的protected权限 ,问题在注释里
  • ¥15 这个是哪里有问题啊?