abtin

abtin

Distributed Services With Go - gogoproto on linux

page 20: … protoc command…
I had to additionally run the following go get commands in order to be able to compile protobuf code using gogo protobuf on a linux machine:

go get github.com/gogo/protobuf/proto
go get github.com/gogo/protobuf/jsonpb
go get github.com/gogo/protobuf/protoc-gen-gogo
go get github.com/gogo/protobuf/gogoproto

I don’t use Mac but it would be nice to mention that the setup on linux is different or point the readers to the git repo for installation instruction. https://github.com/gogo/protobuf/tree/master

Marked As Solved

travisjeffery

travisjeffery

Author of Distributed Services with Go

Hey y’all, I’ve switched the book to use github.com/golang/protobuf because of the release of Go’s protobuf APIv2, gogoprotobuf lacking ownership and projects moving away from using gogoprotobuf: https://github.com/gogo/protobuf/issues/691. This update will be in a subsequent beta release.

Also Liked

youshy

youshy

I’m on the second beta right now, sadly the problem still exists (I’m on Linux).

Used this command to fix:
protoc --gogoslick_out=. -I=. -I=${GOPATH}/src -I=${GOPATH}/src/github.com/gogo/protobuf/gogoproto *.proto

also my log.proto is updated:

syntax = "proto3";

package log.v1;

import "github.com/gogo/protobuf/gogoproto/gogo.proto";

option (gogoproto.marshaler_all) = true;
option (gogoproto.unmarshaler_all) = true;
option (gogoproto.sizer_all) = true;

message Record {
  bytes value = 1;
  uint64 offset = 2;
}
seblegall

seblegall

Hi,

I work on a mac and I had to use this command :

protoc api/v1/*.proto \
		--gogoslick_out=plugins=grpc:. \
		--proto_path=$$(go list -f '{{ .Dir }}' -m github.com/gogo/protobuf) \
		--proto_path=.

Notice the gogoslick_out flag. I had to use that instead of the gogo_out flag described in the book.

The readme file says :

protoc-gen-gogofast (same as gofast, but imports gogoprotobuf)
protoc-gen-gogofaster (same as gogofast, without XXX_unrecognized, less pointer fields)
protoc-gen-gogoslick (same as gogofaster, but with generated string, gostring and equal methods)

But indeed, I didn’t saw the last paragraph “Most Speed and most customization” describing the command you suggest.

So I guess, it’s not a matter of Mac or Linux. Maybe the gogo/protobuf changed is usage ?

To be fair, there is an old README in the git repo (https://github.com/gogo/protobuf/blob/master/README) descripting usage as

protoc --gogo_out=. -I=.:github.com/gogo/protobuf/protobuf *.proto
travisjeffery

travisjeffery

Author of Distributed Services with Go

You didn’t have the second beta right? I believe I fixed this.

Popular Prag Prog topics Top

jeffmcompsci
Title: Design and Build Great Web APIs - typo “https://company-atk.herokuapp.com/2258ie4t68jv” (page 19, third bullet in URL list) Typo:...
New
yulkin
your book suggests to use Image.toByteData() to convert image to bytes, however I get the following error: "the getter ‘toByteData’ isn’t...
New
sdmoralesma
Title: Web Development with Clojure, Third Edition - migrations/create not working: p159 When I execute the command: user=> (create-...
New
Chrichton
Dear Sophie. I tried to do the “Authorization” exercise and have two questions: When trying to plug in an email-service, I found the ...
New
swlaschin
The book has the same “Problem space/Solution space” diagram on page 18 as is on page 17. The correct Problem/Solution space diagrams ar...
New
fynn
This is as much a suggestion as a question, as a note for others. Locally the SGP30 wasn’t available, so I ordered a SGP40. On page 53, ...
New
jskubick
I found an issue in Chapter 7 regarding android:backgroundTint vs app:backgroundTint. How to replicate: load chapter-7 from zipfile i...
New
Charles
In general, the book isn’t yet updated for Phoenix version 1.6. On page 18 of the book, the authors indicate that an auto generated of ro...
New
andreheijstek
After running /bin/setup, the first error was: The foreman' command exists in these Ruby versions: That was easy to fix: gem install fore...
New
mcpierce
@mfazio23 I’ve applied the changes from Chapter 5 of the book and everything builds correctly and runs. But, when I try to start a game,...
New

Other popular topics Top

siddhant3030
I’m thinking of buying a monitor that I can rotate to use as a vertical monitor? Also, I want to know if someone is using it for program...
New
AstonJ
SpaceVim seems to be gaining in features and popularity and I just wondered how it compares with SpaceMacs in 2020 - anyone have any thou...
New
New
Margaret
Hello everyone! This thread is to tell you about what authors from The Pragmatic Bookshelf are writing on Medium.
1122 25118 742
New
Help
I am trying to crate a game for the Nintendo switch, I wanted to use Java as I am comfortable with that programming language. Can you use...
New
First poster: bot
Large Language Models like ChatGPT say The Darnedest Things. The Errors They MakeWhy We Need to Document Them, and What We Have Decided ...
New
DevotionGeo
I have always used antique keyboards like Cherry MX 1800 or Cherry MX 8100 and almost always have modified the switches in some way, like...
New
First poster: bot
zig/http.zig at 7cf2cbb33ef34c1d211135f56d30fe23b6cacd42 · ziglang/zig. General-purpose programming language and toolchain for maintaini...
New
PragmaticBookshelf
Author Spotlight: Bruce Tate @redrapids Programming languages always emerge out of need, and if that’s not always true, they’re defin...
New
CommunityNews
A Brief Review of the Minisforum V3 AMD Tablet. Update: I have created an awesome-minisforum-v3 GitHub repository to list information fo...
New

Latest in PragProg

View all threads ❯