Awesome Content , thanks for that :) I think if you are in same package you don't need to import it in test files, rather just use the name of the function given the name of the function starts with caps.
I was facing the following issue: "cannot use message (type protoreflect.ProtoMessage) as type protoiface.MessageV1 in argument to marshaler.MarshalToString". I guess it was due to version mismatching. Pay attention to the imports and change the ProtobufToJson function to: import ( "google.golang.org/protobuf/encoding/protojson" "google.golang.org/protobuf/proto" ) func ProtobufToJson(message proto.Message) (string, error) { marshaler := protojson.MarshalOptions{ UseEnumNumbers: false, EmitUnpopulated: true, Indent: " ", UseProtoNames: true, } data, err := marshaler.Marshal(message) return string(data), err } github.com/golang/protobuf/issues/1133 Thank you very much for sharing your knowledge with us!
One of the best resources for gRPC! I purchased this course on Udemy as well. Do you have any plans to expand your tutorials, especially the Go programming language itself? If so, that would be great!
Thanks so much, Sri! You can find more tutorials in our youtube channel: ruclips.net/user/TECHSCHOOLGURU This is the backend master course with Golang: ruclips.net/p/PLy_6D98if3ULEtXtNSY_2qN21VCKgoQAE
Hi Kiên, Anh thấy chỉ cần cài golang plugin của vscode, sau đó nó sẽ install một số package của go để có tự động import & auto complete. Em có thể xem video này cho rõ hơn: ruclips.net/video/jRLV-1GVET4/видео.html
In Json serialization we have value (uint64) serialized as string. Why is that the case ?
4 месяца назад
A bit late, however if somebody is interested in the answer. Interoperability as defined by rfc7159. Although technically JSON has no precision limits on numbers, JavaScript and other languages do: 2^53. Unfortunately unit64 falls outside of that range.
Thanks Jerry for the suggestion. However, it's not in the scope of this course at the moment. I believe doing this for NodeJS would be very similar to Go or Java.
Does anybody else have problem with donwload and clone sources from repo on GitLab? I still get message from browser: 429 Too many requests received, and for git from commnd line: git clone git@gitlab.com:techschool/pcbook.git Cloning into 'pcbook'... git@gitlab.com: Permission denied (publickey). fatal: Could not read from remote repository. Please make sure you have the correct access rights and the repository exists.
Awesome Content , thanks for that :) I think if you are in same package you don't need to import it in test files, rather just use the name of the function given the name of the function starts with caps.
Thanks! Good tip!
I was facing the following issue: "cannot use message (type protoreflect.ProtoMessage) as type protoiface.MessageV1 in argument to marshaler.MarshalToString".
I guess it was due to version mismatching.
Pay attention to the imports and change the ProtobufToJson function to:
import (
"google.golang.org/protobuf/encoding/protojson"
"google.golang.org/protobuf/proto"
)
func ProtobufToJson(message proto.Message) (string, error) {
marshaler := protojson.MarshalOptions{
UseEnumNumbers: false,
EmitUnpopulated: true,
Indent: " ",
UseProtoNames: true,
}
data, err := marshaler.Marshal(message)
return string(data), err
}
github.com/golang/protobuf/issues/1133
Thank you very much for sharing your knowledge with us!
Thanks Rodrigo. Indeed there might be some differences in the generated code if you use different versions of protobuf.
This is high quality Go code. Thank you!
Enjoy!
One of the best resources for gRPC! I purchased this course on Udemy as well. Do you have any plans to expand your tutorials, especially the Go programming language itself? If so, that would be great!
Thanks so much, Sri! You can find more tutorials in our youtube channel: ruclips.net/user/TECHSCHOOLGURU
This is the backend master course with Golang: ruclips.net/p/PLy_6D98if3ULEtXtNSY_2qN21VCKgoQAE
I guess jsonpb is deprecated, right? I used protojson instead...
I am getting access denied error while running go test ./... maybe because I dont have permisiion to change the file
e thấy a có viết func xong nó tự điền import đó ạ, không biết nó là extention gì e tìm không thấy a.
Hi Kiên,
Anh thấy chỉ cần cài golang plugin của vscode, sau đó nó sẽ install một số package của go để có tự động import & auto complete.
Em có thể xem video này cho rõ hơn: ruclips.net/video/jRLV-1GVET4/видео.html
In Json serialization we have value (uint64) serialized as string. Why is that the case ?
A bit late, however if somebody is interested in the answer. Interoperability as defined by rfc7159. Although technically JSON has no precision limits on numbers, JavaScript and other languages do: 2^53. Unfortunately unit64 falls outside of that range.
Great Content . Thank you so much !
Glad you liked it!
Thanks for these great resources.
Glad you like them!
Can you also do with nodejs.
Thanks Jerry for the suggestion. However, it's not in the scope of this course at the moment. I believe doing this for NodeJS would be very similar to Go or Java.
Does anybody else have problem with donwload and clone sources from repo on GitLab?
I still get message from browser: 429 Too many requests received, and for git from commnd line:
git clone git@gitlab.com:techschool/pcbook.git
Cloning into 'pcbook'...
git@gitlab.com: Permission denied (publickey).
fatal: Could not read from remote repository.
Please make sure you have the correct access rights
and the repository exists.
Hi Marek, if you haven't set up SSH key for your gitlab account, you should clone by HTTPS instead:
git clone gitlab.com/techschool/pcbook.git
Thank you very much!
Thanks!
Hey how do I find you on linkedin ?
Hi Abhishek, you can find Tech School on Linkedin at this link: www.linkedin.com/company/34649008/admin/