Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

按照流程,go mod tidy 时出现导入包模糊,请问怎么解决 #211

Open
mxyfighting opened this issue Mar 27, 2023 · 7 comments

Comments

@mxyfighting
Copy link

image

@mxyfighting mxyfighting changed the title 按照流程,go mod tidy 时出现保模糊,请问怎么解决 按照流程,go mod tidy 时出现导入包模糊,请问怎么解决 Mar 27, 2023
@mxyfighting
Copy link
Author

mxyfighting commented Mar 27, 2023

我尝试使用go get -d github.com/btcsuite/btcd/chaincfg/[email protected] 解决了这个问题,但是又出现了一个新的问题,显示由abigen编译生成的go包,报错:type *bind.BoundContract has no field or method TransactWithResult,显示没有TransactWithResult这个方法,如下图所示;我检查了所有的github.com/FISCO-BCOS/go-sdk/abi/bind包的版本,但是均没有这个方法TransactWithResult,请问问题是出在哪呢
1

@mxyfighting

This comment was marked as off-topic.

@bxq2011hust
Copy link
Member

bxq2011hust commented Apr 4, 2023

你用的是2.0的还是3.0的go-sdk?
可以参考下这个#151

@mxyfighting
Copy link
Author

我都试过了,2.0的话可以用,但是2.0没有解决下图1这个问题,用3.0的话,解决了下图1这个问题,但是go mod tidy后,导入的包(如图2),这些版本里面都没有这个函数(图3),是不是tag标签没有更新?
image
1
image

@bxq2011hust
Copy link
Member

bxq2011hust commented Apr 13, 2023

这个功能在https://github.com/FISCO-BCOS/go-sdk/tree/master-FISCO-BCOS-v2 的最新提交,还没有打tag
@mxyfighting

@yekai1003
Copy link
Contributor

可以试试将go-sdk工程clone到本地,和开发工程同级目录,然后在go.mod里将依赖指向本地,也就是在go.mod添加下面的代码:
replace github.com/FISCO-BCOS/go-sdk v1.0.0 => ../go-sdk
经过测试,可以跑通Readme的例子。

@Duanraudon
Copy link

把go.mod里面的以太坊的包版本改为v1.9.16就好了

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants