A Practical Guide to Pointers in Go
Вставка
- Опубліковано 3 лип 2024
- 🌎 Follow me here:
Discord: / discord
Twitter: / tomdoes_tech
Facebook: / tomdoestech
Instagram: / tomdoestech
TikTok: / tomdoes_tech
☕ Buy me a coffee: www.buymeacoffee.com/tomn - Розваги
this is great for clearifyiing the doubts.
Great tutorial!
The fact that the editor doesn’t warn when trying to access a potentially nil pointer makes me miss typescript. Are you saying all structs should just have some internal value you use to know if the thing was set or not? Like an isInitalized true bool?
I'm not sure I understand the question, but everything has default values, see this playground: go.dev/play/p/qCJQAwYbCID
I should do a video on what you posted on twitter the other day about no required values on a struct. It would be a nice feature but there's ways to construct the program so you don't really need it.
Hi Tom, can you please share some ways to handle the construction with having the required check,
@@dhruvsaxena8254 you can't get your editor to tell you that it's required, but you can use the builder pattern and either return, or panic in the build method if a field is missing.
Great video, pointers take some time to get your head around.
Editing goof around 4:20 lol
Don't point it out lol 😂
Nice video
Should i learn node js or go, iam so confused?
Are you trying to get a job? JavaScript
@@TomDoesTech want to get into backend and actually also looking for a job,I have tried both but i really want to stick to one and go deeper into it, what do you suggest?
@@avg_user-dd2yb I think your chances of getting a job are higher if you focus on node
Cool next goroutine and concurrency?
Yeah, I think that's a good idea
It is a great pity that such a pleasant language as Go is not null safety.... :(
To be honest, it's rare that I come across these issues. That's why I suggest to not use pointers to make properties optional
It's more common in js where everything is nullable
@@jalalle1995 We're talking about Go, so stop getting unhealthily excited about JavaScript and making empty comments about it.
@@coder_one let me rephrase it, null bugs are more common in languages where everything is nullable
@@jalalle1995 do you have some kind of programming complex that the only thing you can write when the conversation is about the Go language is that in other languages are like this and like that? Seriously, who cares? Grow up boy!