govendor使用

1 下载govendor

go get -u github.com/kardianos/govendor


2 初始化

govendor init

进入src/projectname,生成vendor文件,里面包含一个vendor.json



3 添加依赖

govendor add +external

govendor使用_第1张图片

在vendor目录下添加依赖文件,在vendor.json里面添加依赖

govendor使用_第2张图片

govendor list //查看依赖


4 其他命令

# View your work.
govendor list


# Look at what is using a package
govendor list -v fmt


# Specify a specific version or revision to fetch
govendor fetch golang.org/x/net/context@a4bbce9fcae005b22ae5443f6af064d80a6f5a55
govendor fetch golang.org/x/net/context@v1   # Get latest v1.*.* tag or branch.
govendor fetch golang.org/x/net/context@=v1  # Get the tag or branch named "v1".


# Update a package to latest, given any prior version constraint
govendor fetch golang.org/x/net/context


# Format your repository only
govendor fmt +local


# Build everything in your repository only
govendor install +local


# Test your repository only
govendor test +local

 

你可能感兴趣的:(golang)