Can';t编译包含子模块的Golang项目

Can';t编译包含子模块的Golang项目,go,git-submodules,cgo,go-build,Go,Git Submodules,Cgo,Go Build,我有一个Golang项目,其中有一个git子模块,如下所示: 计划 go.mod 梅因,加油 config.go go区块链/(git子模块) go.mod 加密/ encode.go(其中包含cgo代码) 加密围棋 梅因,加油 在顶层运行go build时,会出现如下错误: #github.com/blockchain/go-blockchain/crypto /Users/niceguiy/.go/pkg/mod/github.com/blockchain/go-blockcha

我有一个Golang项目,其中有一个git子模块,如下所示:

计划

  • go.mod
  • 梅因,加油
  • config.go
  • go区块链/(git子模块)
    • go.mod
    • 加密/
      • encode.go(其中包含cgo代码)
      • 加密围棋
    • 梅因,加油
在顶层运行
go build
时,会出现如下错误:

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

/Users/niceguiy/.go/pkg/mod/github.com/blockchain/go-blockchain@v0.0.0-20200320145517-cea8009ba7ee/crypto/encode.go:86:2:无法确定C.crypto_encode_对的名称类型

/Users/niceguiy/.go/pkg/mod/github.com/blockchain/go-blockchain@v0.0.0-20200320145517-cea8009ba7ee/crypto/encode.go:80:2:无法从种子中确定C.crypto_encode_的名称种类

/Users/niceguiy/.go/pkg/mod/github.com/blockchain/go-blockchain@v0.0.0-20200320145517-cea8009ba7ee/crypto/encode.go:115:9:无法确定C.crypto\u encode\u proof\u to\u散列的名称类型

问题似乎是我更喜欢缓存,而不是构建并存放在go区块链文件夹中的CGO库


建议?

这个问题让互联网难住了吗?我找到了答案。我在Golang代码中有两个单独的模块地址,它们指向同一个git子模块。我有:github.com/nicegay/myblockchain-proj/go-blockchain和github.com/blockchain/go-blockchain答案是始终使用Golang代码中子模块的原始Golang地址:github.com/blockchain/go-blockchain,并在go.mod中使用替换。这个问题困扰了互联网吗?我找到了答案。我在Golang代码中有两个单独的模块地址,它们指向同一个git子模块。我有:github.com/nicegay/myblockchain-proj/go-blockchain和github.com/blockchain/go-blockchain答案是始终使用Golang代码中子模块的原始Golang地址:github.com/blockchain/go-blockchain,并在go.mod中使用替换