Learning Golang Context!! Never Looked At It!

Sdílet
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

Komentáře • 35

  • @enzo.albornoz

    Prime, ninja edition

  • @bennythetiger6052

    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

  • @rpanda_old

    "vim is crap if you want it to be like vscode"

  • @felixw841

    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.

  • @Ujjaval___

    we can see through your brain .😂😂

  • @Mikenight120

    Loving this Go content lately, adding all of them to downloads to binge watch 💯

  • @frechjo
    @frechjo Před 2 hodinami

    So they made dynamic variables. Isn't that what that is about, petty much, just dynamic variables implemented by hand?

  • @kevinkkirimii

    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

  • @SandraWantsCoke

    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.

  • @uby2007

    His hair is the same colour as the text string highlights. lol

  • @gauff3r
    @gauff3r  +25

    Hey Prime, we would love more of your takes on advanced Go topics.

  • @dv_xl
    @dv_xl  +4

    I find that context as a kv store tends to get messy when it's really common in a codebase.

  • @QuantumMechanic343

    Prime, using middleware to put things into a context is a super cool pattern.

  • @param6759

    Love the learing with the Primeagen , would love to see more of this

  • @bryanenglish7841

    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.

  • @gabrielomane-yeboah

    Prime's brain is transparent now

  • @maxpyte1119

    C# (sorry for the curse word), as said earlier, has it as 2 separate concepts: CancellationToken and HttpContext

  • @Dyils

    Didn't think about the green screen when you got that hair, did you? :D

  • @pollathajeeva23

    Gen this is similar to C#' ish Cancellation tokens.