THIS is the BEST Way to Write HTTP Services in Golang

แชร์
ฝัง
  • เผยแพร่เมื่อ 27 ก.ย. 2024

ความคิดเห็น • 46

  • @MelkeyDev
    @MelkeyDev  5 หลายเดือนก่อน +8

    Hope you all enjoy the video - make sure to comment + like and subscribe if you havent already and check out the original article as well!

  • @RayAndrewsDev
    @RayAndrewsDev 5 หลายเดือนก่อน +4

    Its so nice to see that I'm doing a lot of things the "right" way, but this still has a lot of "OH, that would make things so much easier" patterns.
    Looks like I'm going to be updating my API template ... again :) Thanks

    • @MelkeyDev
      @MelkeyDev  5 หลายเดือนก่อน

      Hey thank you :)

  • @lcarv20
    @lcarv20 5 หลายเดือนก่อน +2

    Really cool video, factory for middleware is one thing I have been doing since I learned go.

  • @cabanford
    @cabanford 3 หลายเดือนก่อน +9

    Like your channel (interested in learning Go). Found you from the Primeagen...
    Your video cuts remind me of Max Headroom (from 80s MTV) 😂

    • @MelkeyDev
      @MelkeyDev  3 หลายเดือนก่อน +2

      shout out Primeagen+

    • @omarcrosby
      @omarcrosby 2 หลายเดือนก่อน

      @@MelkeyDev The Primeagen is the best but you're a close second Melkey!

  • @whiteshadow7810
    @whiteshadow7810 5 หลายเดือนก่อน +2

    nice video i coming from Javascript world , Thank you for helping keep going

    • @MelkeyDev
      @MelkeyDev  5 หลายเดือนก่อน +1

      :) no problem. Thank you for the comment

  • @dikan34
    @dikan34 5 หลายเดือนก่อน +4

    Best go content on yt ❤

    • @MelkeyDev
      @MelkeyDev  5 หลายเดือนก่อน +1

      A lot of great people out there make some great Go content but thank you ery much

  • @NoctuaDeveloppement
    @NoctuaDeveloppement 5 หลายเดือนก่อน +1

    Nice video man, good to have more content to rely on. Thanks and keep up

    • @MelkeyDev
      @MelkeyDev  5 หลายเดือนก่อน +1

      Thank you.
      I will always do my best

  • @ninthsun
    @ninthsun 4 หลายเดือนก่อน

    Thanks for introducing awesome post

  • @nikolam-dev
    @nikolam-dev 5 หลายเดือนก่อน +1

    Nice edition, good job

    • @MelkeyDev
      @MelkeyDev  5 หลายเดือนก่อน

      Thank you - hope you enjoy

  • @gearboxworks
    @gearboxworks 5 หลายเดือนก่อน +2

    I really respect Mat Ryer, and even use his moq code generator, but when I read his article I was disheartened to read him advocating for long parameter lists, at least without mentioning the cons for using them vs. structs.
    Simply put, when using long parameter lists you have to break the API of a function to add another dependency which has unfortunate ripple effects in terms of breaking code if 3rd parties are using it, and possibly worse, bloating pull requests often making it much harder and time consuming to review. Theo recently had a video about how larger PRs have been shown to significantly reduce velocity, and google says so too in their eng-practices blog (not posting a URL as TH-cam seems to hide my comments when I do.)
    With structs for optional parameters, nothing breaks if you add new properties and code in a backward compatible manner. I really wish Mat and other Gophers would consider the downsides of broken calls and bloated PRs more when they decide to just keep adding parameters to funcs .🤷‍♂️

    • @MelkeyDev
      @MelkeyDev  5 หลายเดือนก่อน +1

      team structs baby

    • @TehKarmalizer
      @TehKarmalizer 5 หลายเดือนก่อน +1

      Same. That was my biggest issue. Long parameter lists are so cumbersome and rigid. Otherwise it seemed like good advice to someone who has only dabbled in http handling.

  • @_us.m.an_
    @_us.m.an_ 2 หลายเดือนก่อน

    I suggest read Lets go further book it follows some useful patterns

  • @jt099
    @jt099 5 หลายเดือนก่อน +1

    😂😂😂😂😂
    Shoutout to if err != nil had me rolling

    • @MelkeyDev
      @MelkeyDev  5 หลายเดือนก่อน

      BIG shout out

  • @qoobes
    @qoobes 3 หลายเดือนก่อน +1

    Another banger

    • @MelkeyDev
      @MelkeyDev  3 หลายเดือนก่อน

      ANOTHA ONE!!

  • @MarcosVMSoares
    @MarcosVMSoares 3 หลายเดือนก่อน +1

    Why not using the plug pattern for middleware like in Phoenix? Maybe because wirhout a reduce its impossible??

    • @MelkeyDev
      @MelkeyDev  3 หลายเดือนก่อน

      Im not sure I follow the comment

  • @ashimov1970
    @ashimov1970 4 หลายเดือนก่อน

    Why Chi? Aren't there Go native capabilities to make REST APIs?

  • @internetkite
    @internetkite 5 หลายเดือนก่อน

    Thank you 🙏

    • @MelkeyDev
      @MelkeyDev  5 หลายเดือนก่อน

      youre welcome

  • @iamwitchergeraltofrivia9670
    @iamwitchergeraltofrivia9670 5 หลายเดือนก่อน

    Best way not workung enything on steam

  • @theyioel
    @theyioel 5 หลายเดือนก่อน +1

    It reminds me of the Flask boilerplates in Python.

  • @marius-mihailionte339
    @marius-mihailionte339 4 หลายเดือนก่อน +1

    Do you plan to launch a course or something similar with the code example you shown in the video? Saw the name "goschool" and hope you do something similar like you shown as example, liked very much your course on FrontEnd Masters.
    Thank you.

  • @pbentesio
    @pbentesio 5 หลายเดือนก่อน +2

    I stumbled into having encode and decode functions because in a project I used protobufs with an optional json fallback. Having all that logic in one place just made sense.

    • @MelkeyDev
      @MelkeyDev  5 หลายเดือนก่อน

      i love when things just make sense.
      Just gets the BLOOD FLOWING

  • @Cixelsyd32
    @Cixelsyd32 5 หลายเดือนก่อน +4

    Excellent content as always. Hopefully the TH-cam gods start showing you the love your channel deserves.

    • @MelkeyDev
      @MelkeyDev  5 หลายเดือนก่อน

      Haha - pray to the algo Gods LOL

  • @omarcrosby
    @omarcrosby 2 หลายเดือนก่อน

    Fantastic article and video covering it!

  • @falasefemi3344
    @falasefemi3344 5 หลายเดือนก่อน +1

    Thanks for this

    • @MelkeyDev
      @MelkeyDev  5 หลายเดือนก่อน

      Youre very welcome

  • @dyto2287
    @dyto2287 5 หลายเดือนก่อน +1

    Encoding response with generics like "encode[T any](..." is stupid. No need to know type inside the func when passing "any" gives the same result.

    • @MelkeyDev
      @MelkeyDev  5 หลายเดือนก่อน

      team interface{} baby haha