提交:
cd ${GOPATH}/src/github.com/junneyang/xcloud
godep save -v ./...
rm -rf vendor/
git checkout --forcegit
git init
git pull https://github.com/junneyang/xcloud.git master
git add --all
git commit -m "initial commit"
git remote add origin https://github.com/junneyang/xcloud.git
git push origin mastergithub
使用:
mkdir -p ${GOPATH}/src/github.com/junneyang
cd $_ && git clone https://github.com/junneyang/xcloud.git -b release3.1
cd ${GOPATH}/src/github.com/junneyang/xcloudgolang
godep get -v ./...
godep/None go install -v ./...
godep/None go test -v ./...网络
参考开源项目codis https://github.com/CodisLabs/codis
安装godep
官方的安装文档是使用go get github.com/tools/godep
,很惋惜,由于“网络”问题会报一个找不到golang.org/x/tools/go/vcs
的错误。app
而https://github.com/golang/tools 是 golang.org/x/tools的一个镜像,代码是同样的,因此我是以下安装的。ide
go get github.com/golang/tools
ui
在GOPATH\src\github.com
目录下就有tools
文件夹。3d
在src
下和github.com
平级新建golang.org
文件下,在此文件夹下建x
文件夹,而后将tools
都复制进去。code
而后再执行go get github.com/tools/godep
。blog
此时godep安装在你的GOPATH\bin
目录下。
创建一个演示项目来演示godep。
此演示项目的路径要加入到GOPATH
依赖的项目和项目自己都应该是个git repository
cd skeleton\src\wiselyman.org\app
git init git add . git commit
cd skeleton\src\xx.org\dep
git init git add . git commit
skeleton\src\wiselyman.org\app
目录下,执行godep save
,此时会生成Godeps文件夹这时你能够移除xx.org
目录了。
继续使用将用如下命令
参考资料:http://studygolang.com/articles/2147http://www.01happy.com/golang-package-tool-godep/https://github.com/tools/godephttp://daozhao.goflytoday.com/2015/01/golang-godep/官方文档:https://github.com/tools/godepgodep go run main.go godep go build godep go install godep go test