2 回答

TA貢獻1865條經驗 獲得超7個贊
go 的一些依賴管理工具不會提供項目引用的所有代碼。這意味著在某些情況下,可以在帶有 cgo 的 go 文件中使用的 C 代碼不包含在 vendor 目錄中。
我曾兩次使用兩個單獨的供應商工具遇到過這個問題,但有一些工作可以支持這些用例。
到目前為止我發現的最簡單的方法是使用govendor然后導入完整的目錄以確保所有需要的文件都在那里。這是一個非常簡單的解決方案,它忽略了在 go 項目中包含 c 依賴項的很多復雜性,但修復了這個問題,同時沒有永久修復這個問題。
go get github.com/kardianos/govendor
govendor init
govendor add +e
# Remove the directory that is missing the c dependencies
rm -rf ./vendor/github.com/ethereum/go-ethereum/crypto/secp256k1/
# Add the file and include all files
# https://github.com/kardianos/govendor/issues/247
govendor add github.com/ethereum/go-ethereum/crypto/secp256k1/^

TA貢獻1936條經驗 獲得超7個贊
在Gopkg.toml你可以添加
[prune]
go-tests = true
unused-packages = true
non-go = true
[[prune.project]]
name = "github.com/ethereum/go-ethereum"
non-go = false
unused-packages = false
- 2 回答
- 0 關注
- 134 瀏覽
添加回答
舉報