Practical Explanation of Golang INTERFACES

Поделиться
HTML-код
  • Опубликовано: 16 окт 2024
  • In this video I'll give you a practical explanation with real-world examples of how to use interfaces in Go, so you can become a better engineer and make your code more modular and testable.
    ✅ Check the "Complete Backend API in Golang" Course: • Complete Backend API i...
    👉 Join the private community to level up as software engineer: selfmadeengine...
    📢 We're building a Discord community, come and join
    / discord
    x.com/tiago_ta...
    📚 Resources
    Effective Go: go.dev/doc/eff...
    Jordan Orelli Blog post: jordanorelli.c...
    Hope you liked and thanks for watching!
    #golang #api #go

Комментарии • 18

  • @ikshitchaudhari2529
    @ikshitchaudhari2529 6 месяцев назад +9

    Bro you are making killer content on golang, i am just binge watching these amazing tutorials and also following along. Videos like these are so damnn helpful to juniors like us. Keep it up ! and all the best. 🫶

    • @TiagoTaquelim
      @TiagoTaquelim  6 месяцев назад +2

      Thank you so much! I'm glad you're liking them! 💪 more are comming

    • @ikshitchaudhari2529
      @ikshitchaudhari2529 6 месяцев назад +1

      @@TiagoTaquelim waiting for epicness !

  • @prashlovessamosa
    @prashlovessamosa 6 месяцев назад +2

    Awesome explanation Tiago.

  • @lucasbarroso23
    @lucasbarroso23 6 месяцев назад +1

    Great content, thanks Tiago!

  • @saurontrollbrawl
    @saurontrollbrawl 6 месяцев назад +1

    I agree. Your content is amazing!!

  • @rostyslav5334
    @rostyslav5334 6 месяцев назад +2

    Bro, thaaaank you!

  • @agb2557
    @agb2557 6 месяцев назад +1

    Amazing video, a bit fast but after coding along I got it, thanks

  • @de-is
    @de-is 6 месяцев назад +1

    This is Epic! Grand Merci! When I was watching your "How to build ecom API" video, I was thinking "why the hell is he using interfaces here". This is a very good explanation, if not implementation, but purpose is very clear. Videos should be well integrated with each other, guiding us "noob users" to explanations!

  • @aghileslounis
    @aghileslounis 6 месяцев назад +1

    Great video once again

  • @pedrolemos3030
    @pedrolemos3030 6 месяцев назад +1

    Amazing content!

  • @dixztube
    @dixztube 4 месяца назад +2

    im failing to see how any of these interface videos are really that different. it mostly consist of a dev who knows how to use them, flying through code (at least this is a realistic example with some testing) and i dont know ---- feels like these things are just popped out. probably best to just code yourself and get a feel for it

  • @rudrOwO
    @rudrOwO 6 месяцев назад +1

    Oh not the pigeon lmao

  • @jackofjs2243
    @jackofjs2243 6 месяцев назад

    In a recipe rest API I recently created created with go(obviously), since I needed to make Multiple insertions in multiple tables, I used a transaction.
    But...
    I realized in instead of passing a pointer to sql.db e.g
    func (ri *RecipeInstruction) Insert(recipe Recipe, tx *sql.Tx) error {}
    i also wanted to do
    func (ri *RecipeInstruction) Insert(recipe Recipe, tx *sql.BD) error {}
    but I could not find a built in interface that can satisfy both a transaction and a DB.
    Must i create my own? or is this not a proper implementation of interfaces.

    • @TiagoTaquelim
      @TiagoTaquelim  6 месяцев назад

      You could either make the transaction just into a function, everything inside it, then you would not need to pass it around.
      Or you could implement something like this: dev.to/techschoolguru/a-clean-way-to-implement-database-transaction-in-golang-2ba