Build failure in `hashes` example
MikMuellerDev opened this issue · comments
Mik Mueller commented
Cannot build examples
Expected output
- The run / build commands should execute without errors, as this is an official example for learning.
Actual output
[nix-shell:~/Downloads/go-capnp/example/hashes]$ go run -v .
hashes
# hashes
hashes/hashes.capnp.go:40:25: capnp.Client(c).WaitStreaming undefined (type capnp.Client has no field or method WaitStreaming)
hashes/hashes.capnp.go:74:25: capnp.Client(c).EncodeAsPtr undefined (type capnp.Client has no field or method EncodeAsPtr)
hashes/hashes.capnp.go:167:39: HashFactory does not satisfy ~struct{Client capnp.Client} (HashFactory missing in ~struct{Client capnproto.org/go/capnp/v3.Client})
hashes/hashes.capnp.go:224:57: HashFactory_newSha1_Params does not satisfy ~struct{capnp.Struct} (HashFactory_newSha1_Params missing in ~struct{capnproto.org/go/capnp/v3.Struct})
hashes/hashes.capnp.go:306:58: HashFactory_newSha1_Results does not satisfy ~struct{capnp.Struct} (HashFactory_newSha1_Results missing in ~struct{capnproto.org/go/capnp/v3.Struct})
hashes/hashes.capnp.go:529:32: Hash does not satisfy ~struct{Client capnp.Client} (Hash missing in ~struct{Client capnproto.org/go/capnp/v3.Client})
hashes/hashes.capnp.go:598:48: Hash_write_Params does not satisfy ~struct{capnp.Struct} (Hash_write_Params missing in ~struct{capnproto.org/go/capnp/v3.Struct})
hashes/hashes.capnp.go:663:49: Hash_write_Results does not satisfy ~struct{capnp.Struct} (Hash_write_Results missing in ~struct{capnproto.org/go/capnp/v3.Struct})
hashes/hashes.capnp.go:728:46: Hash_sum_Params does not satisfy ~struct{capnp.Struct} (Hash_sum_Params missing in ~struct{capnproto.org/go/capnp/v3.Struct})
hashes/hashes.capnp.go:805:47: Hash_sum_Results does not satisfy ~struct{capnp.Struct} (Hash_sum_Results missing in ~struct{capnproto.org/go/capnp/v3.Struct})
hashes/hashes.capnp.go:74:25: too many errors
Steps to reproduce
- navigate into
go-capnp/example/hashes/hashes
- Bump the go version to something recent, like
1.21.0
- Run the following (
capnp compile -I ../../../std -ogo hashes.capnp
) command to generate the code for thehashes
module - Navigate back into
go-capnp/example/hashes
- Also bump the go version to something recent, like
1.21.0
- Run
go run -v .
Mik Mueller commented
Thank you for the quick fix, your help is very much appreciated!