英文:
GOanda on github for Oanda API Rest in GoLang
问题
当我尝试安装这个包时:
go get github.com/jasonnfls/goanda
我得到了这个错误:
> /usr/local/go/bin/src/github.com/jasonnfls/goanda/trade.go:47: cannot use responseObj (type UpdateTradeResponse) as type OrderResponse in return argument
解决这个问题的最佳方法是什么?
有人对此有好的解决方案吗?
英文:
When I try to install this package:
go get github.com/jasonnfls/goanda
I get this error:
> /usr/local/go/bin/src/github.com/jasonnfls/goanda/trade.go:47: cannot use responseObj (type UpdateTradeResponse) as type OrderResponse in return argument
What would be the best way to resolve this?
Anyone have a good solution to this?
答案1
得分: 0
包中有一个错误。它包含了无效的代码。
解决方案可以是使用一个没有问题的旧版本(如果有的话),修复这个错误,或者让其他人(可能是作者)来修复这个错误。
英文:
There's a bug in the package. It contains invalid code.
The solution would be to use an older version that isn't broken (if there is one), fix the bug, or get someone else (perhaps the author) to fix the bug.
答案2
得分: 0
包中的错误似乎是一个复制粘贴错误。在文件 trade.go
中,将第20行的返回值从 OrderResponse
改为 UpdateTradeResponse
,然后运行 go install github.com/jasonnfls/goanda
。
该文件将位于 $GOPATH/src/github.com/jasonnfls/goanda
。
我向仓库所有者提交了一个修复的拉取请求。
英文:
The bug in the package appears to be a copy/paste error. In the file trade.go
, change the return value on line 20 from OrderResponse
to UpdateTradeResponse
, then run go install github.com/jasonnfls/goanda
.
The file will be in your $GOPATH/src/github.com/jasonnfls/goanda
I submitted a pull request with the fix to the repo owner.
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论