dep
是Go语言依赖管理的正式实验。需要Go 1.8或更高版本才能进行编译。
要使用开始管理依赖项dep
,请从项目的根目录运行以下命令:
dep init
执行后,将生成两个文件:(Gopkg.toml
“清单”),Gopkg.lock
并将必要的软件包下载到vendor
目录中。
假设您有使用github.com/gorilla/websocket
包的项目。dep
将生成以下文件:
Gopkg.toml
# Gopkg.toml example
#
# Refer to https://github.com/golang/dep/blob/master/docs/Gopkg.toml.md
# for detailed Gopkg.toml documentation.
#
# required = ["github.com/user/thing/cmd/thing"]
# ignored = ["github.com/user/project/pkgX", "bitbucket.org/user/project/pkgA/pkgY"]
#
# [[constraint]]
# name = "github.com/user/project"
# version = "1.0.0"
#
# [[constraint]]
# name = "github.com/user/project2"
# branch = "dev"
# source = "github.com/myfork/project2"
#
# [[override]]
# name = "github.com/x/y"
# version = "2.4.0"
[[constraint]]
name = "github.com/gorilla/websocket"
version = "1.2.0"
锁
# This file is autogenerated, do not edit; changes may be undone by the next 'dep ensure'.
[[projects]]
name = "github.com/gorilla/websocket"
packages = ["."]
revision = "ea4d1f681babbce9545c9c5f3d5194a789c89f5b"
version = "v1.2.0"
[solve-meta]
analyzer-name = "dep"
analyzer-version = 1
inputs-digest = "941e8dbe52e16e8a7dff4068b7ba53ae69a5748b29fbf2bcb5df3a063ac52261"
solver-name = "gps-cdcl"
solver-version = 1
有哪个帮你更新/删除/等的包,请找到更多信息的命令正式GitHub库的dep
(对于围棋依赖管理工具)。
go get
如果您不希望这样做,那不是正确的工具。您可以在Google周围搜索特定问题的解决方案。