etcd: `go get github.com/cores/etcd/client` fails on generated code
As of the current commit (a8f9de2abf824db8a3aa7358227653ca00d9f755), I’m unable to cleanly go get github.com/coreos/etcd/client
for use as a library. The build fails when looking at keys.generated.go
.
Running go generate
resolves compilation, though go test github.com/coreos/etcd/client
still fails.
kmitchell @ kmitchell-laptop ~
└─ 0 $ ▶ go get github.com/coreos/etcd/client
# github.com/coreos/etcd/client
go3/src/github.com/coreos/etcd/client/keys.generated.go:72:6: r.EncodeArrayStart undefined (type codec.encDriver has no field or method EncodeArrayStart)
go3/src/github.com/coreos/etcd/client/keys.generated.go:80:6: r.EncodeMapStart undefined (type codec.encDriver has no field or method EncodeMapStart)
go3/src/github.com/coreos/etcd/client/keys.generated.go:83:6: z.EncSendContainerState undefined (type codec.genHelperEncoder has no field or method EncSendContainerState)
go3/src/github.com/coreos/etcd/client/keys.generated.go:91:6: z.EncSendContainerState undefined (type codec.genHelperEncoder has no field or method EncSendContainerState)
go3/src/github.com/coreos/etcd/client/keys.generated.go:93:6: z.EncSendContainerState undefined (type codec.genHelperEncoder has no field or method EncSendContainerState)
go3/src/github.com/coreos/etcd/client/keys.generated.go:102:6: z.EncSendContainerState undefined (type codec.genHelperEncoder has no field or method EncSendContainerState)
go3/src/github.com/coreos/etcd/client/keys.generated.go:109:6: z.EncSendContainerState undefined (type codec.genHelperEncoder has no field or method EncSendContainerState)
go3/src/github.com/coreos/etcd/client/keys.generated.go:111:6: z.EncSendContainerState undefined (type codec.genHelperEncoder has no field or method EncSendContainerState)
go3/src/github.com/coreos/etcd/client/keys.generated.go:119:6: z.EncSendContainerState undefined (type codec.genHelperEncoder has no field or method EncSendContainerState)
go3/src/github.com/coreos/etcd/client/keys.generated.go:126:6: z.EncSendContainerState undefined (type codec.genHelperEncoder has no field or method EncSendContainerState)
go3/src/github.com/coreos/etcd/client/keys.generated.go:126:6: too many errors
Workarounds I’ve used:
- Vendoring an older version of
etcd/client
andcodecgen
packages works around the issue. clientv3
builds and passes tests.- Cloning the etcd repo separately, then using
glide
to pull in the repo’s dependencies, results in a successful build & test ofgithub.com/coreos/etcd/client
. This isn’t viable on its own for use as a library in other projects, but merging the etcd glide files with the project’s glide file could work to get a functional build.
About this issue
- Original URL
- State: closed
- Created 7 years ago
- Reactions: 1
- Comments: 34 (15 by maintainers)
Commits related to this issue
- codec: streamline library: refactor sendContainerState and clean up handle-specific test flags refactor sendContainerState to be methods on (en|de)cDriver Basically, move from sendContainerState... — committed to ugorji/go by ugorji 7 years ago
- Updated vendored deps Using github.com/docker/libkv, which is unmaintained, instead of the one maintained by the original author github.com/abronan/libkv as it has references to coreos branch. Fixed... — committed to jllopis/getconf by jllopis 7 years ago
- Import Debian changes 3.3.25+dfsg-7ubuntu0.22.04.1 etcd (3.3.25+dfsg-7ubuntu0.22.04.1) jammy-security; urgency=medium * No-change rebuild for golang-golang-x-text etcd (3.3.25+dfsg-7) unstable; u... — committed to balabit-deps/balabit-os-9-etcd by dodys a year ago
just remove
keys.generated.go
fix the problem.keys.generated.go
will be generated automaticallyShould be fixed via https://github.com/coreos/etcd/pull/8721.