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

Cannot use 'loginHooks' (type *"github.com/bilibili/twirp".ServerHooks) as type *"github.com/twitchtv/twirp".ServerHooks #18

Closed
learninto opened this issue Apr 9, 2020 · 3 comments

Comments

@learninto
Copy link

路径:cmd/server/http.go

错误信息:Cannot use 'loginHooks' (type *"github.com/bilibili/twirp".ServerHooks) as type *"github.com/twitchtv/twirp".ServerHooks

如图:
image

@taoso
Copy link
Member

taoso commented Apr 9, 2020

是不是引错包了。 sniper 依赖的是 github.com/bilibili/twirp 不是 github.com/twitchtv/twirp

@learninto
Copy link
Author

learninto commented Apr 9, 2020

使用go run cmd/sniper/main.go rpc生成的代码

cmd/server/http.go 中 引用的是 《"github.com/bilibili/twirp"》
rpc/shop/v1/service.twirp.go 引用的是 《import twirp "github.com/twitchtv/twirp"》

将 rpc/shop/v1/service.twirp.go 引用的twirp包改为:github.com/bilibili/twirp 报如下错误:
image

是不是引错包了。 sniper 依赖的是 github.com/bilibili/twirp 不是 github.com/twitchtv/twirp

@taoso
Copy link
Member

taoso commented Apr 10, 2020

请使用这个 protoc-gen-twirp,文档里已经有说明了。你应该用的是原版 protoc-gen-twirp

@taoso taoso closed this as completed Apr 10, 2020
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

2 participants