1. 问题现象
使用 golang etcd
导入包 github.com/coreos/etcd/clientv3
库时有如下错误:
../github.com/coreos/etcd/pkg/logutil/zap_journal.go:29:2:
cannot find package "github.com/coreos/go-systemd/journal" in any of:
/usr/local/go/src/github.com/coreos/go-systemd/journal (from $GOROOT)
/home/wohu/GoCode/src/github.com/coreos/go-systemd/journal (from $GOPATH)
2. 解决方案
下载对应的的代码包
git clone https://github.com/coreos/go-systemd.git
然后将 go-systemd
目录拷贝到 $GOPATH/src/github.com/coreos/go-systemd
目录下。