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

双向流示例代码有误 #67

Closed
jiaohu opened this issue Aug 17, 2021 · 0 comments · Fixed by #64
Closed

双向流示例代码有误 #67

jiaohu opened this issue Aug 17, 2021 · 0 comments · Fixed by #64

Comments

@jiaohu
Copy link

jiaohu commented Aug 17, 2021

文档地址

下面这块代码有问题

func (handler) BidiSideStreaming(stream echo.EchoService_BidiSideStreamingServer) (err error) {
    go func() {
        for {
            req, err := stream.Recv()
            if err != nil {
                return err
            }
        }
    }()
    for {
        resp := &echo.Response{Msg: "world"}
        if err := stream.Send(resp); err != nil {
            return err
        }
    }
}
@lsjbd lsjbd linked a pull request Aug 18, 2021 that will close this issue
@lsjbd lsjbd closed this as completed Aug 18, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging a pull request may close this issue.

2 participants