Nice video, but would have loved to see more of protobuf, instead of the custom file encoding. Would have been able to encode the file content as a proto message with something like: message TaskList { repeating Task tasks = 1; }
+1 for gRPC! It's been something on my list of things to learn for a while so a video to get me started would be great! After this video I'm thinking of implementing protocol buffers into another language...
A nice episode. I would like more episodes like this and technical stuff. In that breath, I welcome the creating of CLI programs with cobra 😁 👌. You can improve on the sound too.
Great video! :) I'm wondering, if it would make sense to encode the length using protobuf (e.g. `proto.EncodeVarint()`) instead of gob or binary. So you could stick to just one encoding format instead of mixing them.
I have an issue with protobuf un marshalling. Can you tell me is there any best package wich gives us best performance in go for un marshalling proto buf
gob isn't a straight binary conversion and therefore doesn't always takes 8 bytes. If it can fit in 4 bytes ( with some overhead) it will do it. Here is a script that demonstrates how an int64 in gob can have varying length play.golang.org/p/En8KbZIgcB7 Francesc's script would have worked until it reaches 2^8 tasks where the length would have increased to 5.
Great video. To clarify, is the 4 bytes that you're using to store the length of the message indicitive of how protobufs are intended to be formatted, or is this just the format that you chose?... In regards to serialization for the example that you have here. I've been digging into gRPC, can't wait to watch your other videos on the topic. Keep up the great work, I learn a lot from you.
Isn't the YETI a mic where you talk into it from the side... not the mic pointed at your mouth like that? I think that's the issue here. As it stands now, it's actually pointed at his lap.
I don't care for using gob to encode the number of bytes because gob is specific to go. If I want to decode this in a different language, I'd have to deal with gob's conversion of int64 into that system's types. I prefer to use binary.Write() and binary.Read() and just write the length without the type information.
I'm new to Go and I'm quite confuse here. When dealing with files, when we should close and when we can just simply ignore it? In your video here, you close it when you were adding a todo task. But, you didn't close it when you were accessing todo task.
That's because he used ioutil.ReadFile to read file. This function has already handle closing the file you read. you can visit golang.org/src/io/ioutil/ioutil.go?s=1503:1549#L42 to read its source code.
Great explanation. While working with grpc on a daily basis, we realized that it is sometimes somewhat cumbersome to work with the golang types generated by protoc. Therefore we wrote a small protoc plugin that will generate additional custom structs that are easier to use in go and also allow one to use embedded structs and golang struct tags. The plugin is not yet fully feature complete but it would be awesome, if you could take a quick look at it and provide us with some feedback. github.com/dkfbasel/protobuf/tree/master/protoc-gen-gostructs
Maciej It's not a plugin. That keyboard is from macOS, it can be used anywhere not just vscode. Activate it with Ctrl + Cmd + Space, if I recall correctly.
you are insanely talented. I haven't seen anyone code as intuitively and as confident as you do.
I'm 2 minutes into the video, and I can tell you I'm interested in literally everything you said 👍👍👍
gRPC and then cobra would be nice. Great video. Thanks.
more about grpc in the context of microservices would be great👏👏👏👏👏
Nice video, but would have loved to see more of protobuf, instead of the custom file encoding. Would have been able to encode the file content as a proto message with something like:
message TaskList {
repeating Task tasks = 1;
}
+1 for gRPC! It's been something on my list of things to learn for a while so a video to get me started would be great! After this video I'm thinking of implementing protocol buffers into another language...
Sound/mic problem today?
Mark Ayers sounds like he’s on his laptop mic not the yeti
Mark Ayers pio
yeah sad day about the mic. But thank you for your patient vids
He forgot to connect the yeti :p
A nice episode. I would like more episodes like this and technical stuff. In that breath, I welcome the creating of CLI programs with cobra 😁 👌. You can improve on the sound too.
Cool video. Please make a video on how to design an REST API that has generic methods to perform CRUD operations in multiple tables.
Thank you I always learn something new and useful with your justforfunc videos :)
perfect timing!! I was looking for documentation on this topic!
Please start uploading more videos, grafana logrus would be great or anything related to Golang 😀. Thanks
Thank you for video great as always! More information about Cobra and gRPC would be great!
thanks a lot for all the tutorials! could you, please make a video on a bit more complex chans usage with a real life usage. Thanks :)
more about technical stuff please!
Are you asking for the technical details about protobufs themselves?
Either Viper+Cobra or instrumenting Go code with Prometheus
+1 for something involving Prometheus and Grafana
Great video! :) I'm wondering, if it would make sense to encode the length using protobuf (e.g. `proto.EncodeVarint()`) instead of gob or binary. So you could stick to just one encoding format instead of mixing them.
I have an issue with protobuf un marshalling. Can you tell me is there any best package wich gives us best performance in go for un marshalling proto buf
Why int64 is []byte[:4] ? Isn’t it int32?
Artem Alekseev I have the exact same question
because in my head 64 / 8 = 4 ... good catch!
github.com/campoy/justforfunc/pull/56
gob isn't a straight binary conversion and therefore doesn't always takes 8 bytes. If it can fit in 4 bytes ( with some overhead) it will do it.
Here is a script that demonstrates how an int64 in gob can have varying length
play.golang.org/p/En8KbZIgcB7
Francesc's script would have worked until it reaches 2^8 tasks where the length would have increased to 5.
Where did the editor disappear after 26:08? :/
Can someone explain me more about the numbers 1, 2, 3 why we are adding it at the last of each line, I don't understand it properly??
Great stuff! I would like more videos soon :-)
How to implement protocol buffer in objective c. can we create a library out of it so that we can use generated objective c files independently.
Great video. To clarify, is the 4 bytes that you're using to store the length of the message indicitive of how protobufs are intended to be formatted, or is this just the format that you chose?... In regards to serialization for the example that you have here. I've been digging into gRPC, can't wait to watch your other videos on the topic. Keep up the great work, I learn a lot from you.
viper and cobra in depth would be nice.
Hi, ¿how did you install your environment?, the compiler, ¿what are you using?
Nice, I was actually wondering this too
I'm highly interested in this topic but sadly the quality of the sound is not as good as you always did.
Thank you very much by the way for the video!
+1 for cobra :-)
+1 that +1 for cobra
+1 gRPC. Cheers!
what is the code editor being used here?
Isn't the YETI a mic where you talk into it from the side... not the mic pointed at your mouth like that? I think that's the issue here. As it stands now, it's actually pointed at his lap.
Great job as usual! Q: when I do a `cat mydb.pb | protoc --decode_raw` I get a `Failed to parse input.`. Which `protoc` version have you got?
+1 for Cobra!
👍🏻x 1000 for gRPC
I don't care for using gob to encode the number of bytes because gob is specific to go. If I want to decode this in a different language, I'd have to deal with gob's conversion of int64 into that system's types. I prefer to use binary.Write() and binary.Read() and just write the length without the type information.
I'm new to Go and I'm quite confuse here. When dealing with files, when we should close and when we can just simply ignore it?
In your video here, you close it when you were adding a todo task. But, you didn't close it when you were accessing todo task.
You should always close it once you're done with it, so that's probably a bug
That's because he used ioutil.ReadFile to read file. This function has already handle closing the file you read. you can visit golang.org/src/io/ioutil/ioutil.go?s=1503:1549#L42 to read its source code.
@@yangchen392 thanks!
✔ the emoji for the checkbox is "check" @justforfunc 😉
(y) cobra !! huge fan of your videos :)
please we need one video pprof example
Great explanation. While working with grpc on a daily basis, we realized that it is sometimes somewhat cumbersome to work with the golang types generated by protoc. Therefore we wrote a small protoc plugin that will generate additional custom structs that are easier to use in go and also allow one to use embedded structs and golang struct tags.
The plugin is not yet fully feature complete but it would be awesome, if you could take a quick look at it and provide us with some feedback. github.com/dkfbasel/protobuf/tree/master/protoc-gen-gostructs
Not gonna lie sort of expected a Minecraft tutorial after that intro :(
I want that emoji plugin ! What plugin are you using and how did you set it up ? Cheers :)
Maciej It's not a plugin. That keyboard is from macOS, it can be used anywhere not just vscode. Activate it with Ctrl + Cmd + Space, if I recall correctly.
Well I didn't know that, Thank you mate ! :)
gRPC and then Cobra please! :)
Great vid 👍, but how do you insert emoji in vscode?
That keyboard is from macOS, it can be used anywhere not just vscode. Activate it with Ctrl + Cmd + Space, if I recall correctly.
On windows you can use windows key + .
+1 for Cobra :)
grpc 👍
cobra 😱
I can smell Feijoada! kkk
Please fix the echo in the room.
Nice video. I find your mac os installed Chinese input。Ha ha
对!可是我的中文不很好 😅
bad microphone? :(
interested in Cobra :)
Problem with voice :(, nice video by the way
Btw What are your thoughts about github.com/twitchtv/twirp ?
+1 cobra
Get thyself some sound absorption panels.
+1 on cobra, after grpc
05:12 Learning pinyin?
Yup, and I activated the Pinyin keyboard by mistake haha
Do a cobra
audio quality really bad :
question!! you know mandarin?? 5:12
+1
Yes please for Cobra.
mixing gob with protobuf - sooo ugly... BTW it's a shame that Unmarshall does not return size read...
Talk about being funcy
Wow, you just ruclips.net/video/_jQ3i_fyqGA/видео.html type chinese!!! Lol
I wanted to watch, but the mic quality is absolute potato
Are potatoes good or bad?
dude, fix your freaking audio
Thanks for watching, I guess
hehehe no problem!
+1 for Cobra!