Learning Golang Context!! Never Looked At It!
Vložit
- čas přidán 1. 02. 2024
- LIVE ON TWITCH: / theprimeagen
Become a backend engineer. Its my favorite site
boot.dev/?promo=PRIMEYT
This is also the best way to support me is to support yourself becoming a better backend engineer.
Get in on Discord: / discord
Get in on Twitter: / theprimeagen
Got Something For Me to Read or Watch??:
/ theprimeagenreact
Prime, ninja edition
Started learning go a week ago as a experienced developer and boy oh boy do I already love it with all my heart. It's all so easyyy and simple and straight to the point
"vim is crap if you want it to be like vscode"
The cast can not blow up because it’s one with two assignments (There’s probably a proper name for this): the casted value and ok (bool indicating if the cast was successful). This is even mentioned in the comment above in the example code.
we can see through your brain .😂😂
Loving this Go content lately, adding all of them to downloads to binge watch 💯
So they made dynamic variables. Isn't that what that is about, petty much, just dynamic variables implemented by hand?
Children cannot cancel the parent but they can cancel their own children's context derived from them. I have seen open telemetry using context in a great way
I do a DB lookup of a user by his token and then I put all the necessary info into context (key, value) and use it across the functions which have access to the request. It's just something you share data across functions within one request.
His hair is the same colour as the text string highlights. lol
Hey Prime, we would love more of your takes on advanced Go topics.
I find that context as a kv store tends to get messy when it's really common in a codebase.
Prime, using middleware to put things into a context is a super cool pattern.
Love the learing with the Primeagen , would love to see more of this
Context is amazing. Watching you learn Go is super awesome, I’ve been with it for almost 10 years and it just now feels like Go is getting its due.
17:28
Prime's brain is transparent now
C# (sorry for the curse word), as said earlier, has it as 2 separate concepts: CancellationToken and HttpContext
Didn't think about the green screen when you got that hair, did you? :D
Gen this is similar to C#' ish Cancellation tokens.