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

Issue in Chapter12 GRPC example #5

Open
danmacklin10 opened this issue Jan 4, 2022 · 2 comments
Open

Issue in Chapter12 GRPC example #5

danmacklin10 opened this issue Jan 4, 2022 · 2 comments

Comments

@danmacklin10
Copy link

Hi,

Firstly want to let you know how much I have learned from your book it is great :-)

I ran into an issue on listing 12-21. I found that the protoc compiler was not generating the RobotMaidService from the proto file.

I therefore made the following work-around.

I changed the Rosie struct to embed housework.UnimplementedRobotMaidServer in listing 12-21.

type Rosie struct {
	housework.UnimplementedRobotMaidServer
	mu     sync.Mutex
	chores []*housework.Chore
}

I also removed the Service function from listing 12-21.

Then in listing 12-22 I changed the way that the server was instantiated in the main function.

server := grpc.NewServer()
rosie := new(Rosie)
housework.RegisterRobotMaidServer(server, rosie)

After making these changes the example worked great.

Many thanks

Dan

@adamwoolhether
Copy link

I've encountered the same thing. I'd imagine it's due to recent changes in gRPC proto generators for go:
grpc/grpc-go#3794

Either way, your solution works.

@awoodbeck
Copy link
Owner

Thank you, gentlemen. I haven't had the bandwidth yet to check this out. I had to make significant changes to the gRPC chapter twice before publishing because of breaking changes. So, although this is disappointing, it doesn't surprise me.

Going forward, I'll update the repo (unless you'd like to make a PR?) and keep it current. I'll also see if No Starch Press can update future printings of the book to maintain its accuracy.

Per Dr. Porter's request #3 , I should put some time into improving the documentation specifically in this repo. I could also throw a README in chapter 12 to address future potential breaking changes.

In any case, I appreciate the feedback.

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

3 participants