rm -rf etcd
mkdir etcd
export GOPATH=`pwd`/etcd
#go get -d -v github.com/etcd-io/etcd/...
mkdir -p $GOPATH/src/github.com/etcd-io/etcd
git clone --depth 1 https://github.com/etcd-io/etcd $GOPATH/src/github.com/etcd-io/etcd
#go get -v -d -u go.etcd.io/etcd
#go get -v -d -u go.etcd.io/etcd/etcdctl
( cd $GOPATH/src/github.com/etcd-io/etcd
  #export GO111MODULE=on
  #go mod vendor -v
  go get -v -d .
)
chmod -R a+rw etcd
tar -c -v -f- --exclude .git etcd | xz -9 >etcd-`date '+%Y%m%d'`.tar.xz
rm -rf etcd
