Can't compile Golang project that contains submodule

769 Views Asked by At

I have a Golang project with one git submodule like follows:

Project

  • go.mod
  • main.go
  • config.go
  • go-blockchain/ (git Submodule)
    • go.mod
    • crypto/
      • encode.go (This has cgo code in it)
      • crypto.go
    • main.go

When I run go build at the top level, I get errors like:

# github.com/blockchain/go-blockchain/crypto

/Users/niceguy/.go/pkg/mod/github.com/blockchain/[email protected]/crypto/encode.go:86:2: could not determine kind of name for C.crypto_encode_pair

/Users/niceguy/.go/pkg/mod/github.com/blockchain/[email protected]/crypto/encode.go:80:2: could not determine kind of name for C.crypto_encode_from_seed

/Users/niceguy/.go/pkg/mod/github.com/blockchain/[email protected]/crypto/encode.go:115:9: could not determine kind of name for C.crypto_encode_proof_to_hash

The problem appears to be that I'm favoring the cache over the CGO libraries that are built and deposited back in the go-blockchain folder.

Suggestions?

0

There are 0 best solutions below