Questions tagged [protobuf-go]
76 questions
2
votes
1 answer
Compile time error of cosmos-sdk/proto/bank/v1beta1/query.proto file
After installing the protoc and saving the cosmos-sdk/proto/bank/v1beta1/query.proto file this file shows a lot of error and for acknowledging the error I ran this command protoc --go_out=. query.proto
Here is the problem…

Md. Saiful Islam
- 81
- 6
2
votes
1 answer
Unmarshal protojson formatted Firestore cloud event into map[string]interface{} or struct
Is there an easy way to unmarshal Firestore data in protojson format into a map[string]interface{} or struct without all the protobuf data type tags? i.e. flatten the protojson data.
I have a Google cloud function that's triggered whenever a new…

Benno
- 169
- 8
2
votes
1 answer
Converting Go []interface{} to protobuf Repeated Array
I have a service written in Go that get data from rest api and return that data as a grpc server. I got an array of object. And I want to return it through the grpc protobuf file. But it keeps failing because of type issue as the data from the api…

dagogodboss
- 483
- 1
- 4
- 19
2
votes
1 answer
How to unmarshal protbuf data into custom struct in Golang
I have a proxy service that translate protobuf into another struct. I
can just write some manual code to do that, but that is inefficient and boilerplate. I can also transform the protobuf data to JSON, and deserlize the JSON data into the…

silverwen
- 287
- 3
- 11
2
votes
1 answer
How to convert/assign a value with type *string to type *wrapperspb.StringValue when the *string value is nil?
I am trying to assign a value with type *string to a variable with type *wrapperspb.StringValue. However, when the *string is nil, it triggers an error (please see the comments in the snipped code to see what kind of error).
Here is a simplified…

Yusril Maulidan Raji
- 1,682
- 1
- 21
- 46
2
votes
1 answer
Revert to Earlier Version of protoc-gen-go
I'm attempting to compile from protobuf files into golang. After compilation, I see this in the generated pb.go
// Code generated by protoc-gen-go. DO NOT EDIT.
// versions:
// protoc-gen-go v1.23.0
// protoc v3.12.3
and
// This is a…

Spirit_Coffee
- 63
- 2
- 6
2
votes
1 answer
How to unmarshal files into descriptorpb.FileDescriptorProto
I'm struggling with Golang Protobuf APIv2.
I'm trying to envelope protobuf messages so that I can invoke functions on a server; functions that aren't known at compile time. Something of the form:
syntax = "proto3";
package p;
import…

DazWilkin
- 32,823
- 5
- 47
- 88
2
votes
0 answers
How to generate a map of string slices from protobuf file?
As the protocol-buffers documentation describes:
Each map field generates a field in the struct of type
map[TKey]TValue where TKey is the field's key type and TValue is
the field's value type...
I would like to set TValue to be a slice of…

Tim
- 1,585
- 1
- 18
- 23
1
vote
1 answer
How to receive a JSON with arbitrary fields value types and Unmarshal to map[string]any using protobuf
This is my proto file:
import "google/protobuf/struct.proto";
service Renderer {
rpc Render(Request) returns (Response) {}
}
message Request {
string template = 1;
string locale = 2;
google.protobuf.Struct variables = 3;
}
In the…

Eleandro Duzentos
- 1,370
- 18
- 36
1
vote
0 answers
GRPC-GW - HTTP service not registering
trying to create a grpc server with a http gw server. The GRPC server is working as expected on port 8081, I can ping and get a proper response. When I ping the http endpoint (localhost:8082/v1/ums2) I keep getting 501 not implemented. Ive tried to…

pro_mo
- 13
- 5
1
vote
0 answers
define a valid foreign key for relations or implement the Valuer/Scanner interface
2023/08/23 15:24:39 C:/Code/vblog/skill/rpc/protobuf/blog/impl/blog.go:19
[error] invalid field found for struct protobuf/blog.Blog's field Meta: define a valid foreign key for relations or implement the Valuer/Scanner interface
message Meta {
…

ssxszt
- 11
- 1
1
vote
0 answers
Protobuf3 string validation fails with regex pattern in Go (golang)
I use Go (golang) as my programming language together with Protobuf3 (protoc-gen-validate)to define my PB messages and rpc methods.
Part of my message looks like that:
string xxxxxx = 1 [
(google.api.field_behavior) = OUTPUT_ONLY,
…

panos
- 328
- 1
- 4
- 16
1
vote
0 answers
Managing Conflicting Proto File Packages and Import Paths in Go
I have two proto files in the same folder.
Because of the history, a.proto's package name is different from b.proto. But they have a same message variable. Meanwhile, we can not change the defination because if we do this, there are too many files…

Wyatt
- 1,357
- 5
- 17
- 26
1
vote
2 answers
I want to generate protobufs from proto files from cmd without using "option go_package "
I have to generate protobuf file from a proto file which import another proto file.
One another requirement, this has to be generated by cmd (by not defining "option go_package" in the proto file).

Vikash Mishra
- 67
- 4
1
vote
1 answer
How to correctly determine the type of variable google.protobuf.Any?
Please tell me what is wrong in this code, why the type is not determined for the variable, for the transmitted url type google.protobuf.Any?
package main
import (
"fmt"
"google.golang.org/protobuf/reflect/protoreflect"
…

Yuri
- 13
- 3