Coder Social home page Coder Social logo

照你代码写的,导入你github的hello.pb.go是ok的,我本地的却不可以呢,两者一模一样的啊 about go-grpc-tutorial HOT 5 CLOSED

jergoo avatar jergoo commented on July 19, 2024
照你代码写的,导入你github的hello.pb.go是ok的,我本地的却不可以呢,两者一模一样的啊

from go-grpc-tutorial.

Comments (5)

jergoo avatar jergoo commented on July 19, 2024

@zldafeng 能多提供一些信息吗?从你说明的这个错误,我只能推断你的server/main.go中的helloService没有实现hello.pb.go中的HelloServer接口。确定是引入的hello.pb.go不一样导致的吗?对比下项目的文件和你自己编译生成的文件看看有什么区别。

from go-grpc-tutorial.

jergoo avatar jergoo commented on July 19, 2024

@zldafeng 确认你本地"google.golang.org/grpc"库是否最新,本地有没有"golang.org/x/net/http2",你看错误信息里那个文件的465行,调用了*http2.Framer的SetReuseFrames方法,没找到显然是你本地的库不完整或者没更新导致的。

from go-grpc-tutorial.

jergoo avatar jergoo commented on July 19, 2024

@zldafeng 确认你的"golang.org/x/net/http2"是不是更新成功了,可能需要翻墙,你看github上最新的文件"https://github.com/golang/net/blob/master/http2/frame.go"

from go-grpc-tutorial.

jergoo avatar jergoo commented on July 19, 2024

@zldafeng 😓我没办法确认你到底遇到了什么问题,你可以尝试多打印一些日志,看看到底哪个步骤出错了。

from go-grpc-tutorial.

jergoo avatar jergoo commented on July 19, 2024

@zldafeng 换个端口试一下。

我准备关闭这个issue了,我已经没有耐心在这里这样一个一个问题的回答你了,还有问题可以直接给我发邮件。我认为上面你提出的每个问题都不是复杂的技术问题,完全是可以自己解决的。

第一个问题:“Cannot use HelloService (type helloService) as type HelloServer”明显的go类型错误
第二个问题:也是很明显你本地包文件缺东西,你可以根据错误信息一层层找到那个文件,确认是不是真的缺东西
第三个问题:百度就有一堆结果

另外,在提问题的时候,建议不要只是把错误信息粘上去就指望别人回复你。至少要说明是怎么遇到的问题,什么开发环境,尝试了什么解决办法及结果,用搜索引擎了吗。

说这些没别的意思,有问题当然是欢迎交流的,但是我希望不是这种形式。

from go-grpc-tutorial.

Related Issues (8)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.