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

mikecargal
Title: Hands-On Rust (Chap 8 (Adding a Heads Up Display) It looks like ​.with_simple_console_no_bg​(SCREEN_WIDTH*2, SCREEN_HEIGHT*2...
New
edruder
I thought that there might be interest in using the book with Rails 6.1 and Ruby 2.7.2. I’ll note what I needed to do differently here. ...
New
raul
Page 28: It implements io.ReaderAt on the store type. Sorry if it’s a dumb question but was the io.ReaderAt supposed to be io.ReadAt? ...
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
curtosis
Running mix deps.get in the sensor_hub directory fails with the following error: ** (Mix) No SSH public keys found in ~/.ssh. An ssh aut...
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
hazardco
On page 78 the following code appears: <%= link_to ‘Destroy’, product, class: ‘hover:underline’, method: :delete, data: { confirm...
New
jonmac
The allprojects block listed on page 245 produces the following error when syncing gradle: “org.gradle.api.GradleScriptException: A prob...
New
gorkaio
root_layout: {PentoWeb.LayoutView, :root}, This results in the following following error: no “root” html template defined for PentoWeb...
New
SlowburnAZ
Getting an error when installing the dependencies at the start of this chapter: could not compile dependency :exla, "mix compile" failed...
New

Other popular topics Top

DevotionGeo
I know that these benchmarks might not be the exact picture of real-world scenario, but still I expect a Rust web framework performing a ...
New
axelson
I’ve been really enjoying obsidian.md: It is very snappy (even though it is based on Electron). I love that it is all local by defaul...
New
PragmaticBookshelf
Rust is an exciting new programming language combining the power of C with memory safety, fearless concurrency, and productivity boosters...
New
AstonJ
This looks like a stunning keycap set :orange_heart: A LEGENDARY KEYBOARD LIVES ON When you bought an Apple Macintosh computer in the e...
New
Exadra37
Oh just spent so much time on this to discover now that RancherOS is in end of life but Rancher is refusing to mark the Github repo as su...
New
rustkas
Intensively researching Erlang books and additional resources on it, I have found that the topic of using Regular Expressions is either c...
New
PragmaticBookshelf
Rails 7 completely redefines what it means to produce fantastic user experiences and provides a way to achieve all the benefits of single...
New
husaindevelop
Inside our android webview app, we are trying to paste the copied content from another app eg (notes) using navigator.clipboard.readtext ...
New
PragmaticBookshelf
A Ruby-Centric Chat with Noel Rappin @noelrappin Once you start noodling around with Ruby you quickly figure out, as Noel Rappi...
New
AstonJ
This is a very quick guide, you just need to: Download LM Studio: https://lmstudio.ai/ Click on search Type DeepSeek, then select the o...
New

Latest in PragProg

View all threads ❯