Building REST APIs in Go 1.22 - New Features

Поділитися
Вставка
  • Опубліковано 11 жов 2024
  • Welcome Gophers! In this video, we'll be covering the exciting new functionality in Go 1.22 that allows you to create far more succinct REST APIs in Go!
    👨‍💻 Sign up and gain access to a growing list of premium courses on my site - tutorialedge.n...
    ✅ Subscribe and hit that 🔔 to get notified for all the latest tutorials!
    🤓 / elliot_f
    ‎💻 tutorialedge.net
    🎥 Recording Setup
    Microphone - amzn.to/3hvASys
    Mic Boom - amzn.to/3o0cW8Q
    Mouse - amzn.to/2WZMoZs
    Monitor 1 - amzn.to/38IUlYy
    Monitor 2 - amzn.to/3rBTZf7
    Mount - amzn.to/3o3185V
    USB-C Hub - amzn.to/3o2xRbw

КОМЕНТАРІ • 34

  • @kirillbaryba746
    @kirillbaryba746 7 місяців тому +13

    Thanks! It would be interesting to show how to correctly create a structure for APIs for different entities

    • @Tutorialedge
      @Tutorialedge  7 місяців тому +5

      Thanks for your comment! That's a great suggestion for a standalone video topic, I'll add it to the queue!

    • @markmckenzie5343
      @markmckenzie5343 7 місяців тому +3

      Agreed, you have no idea the state of someone's shell history and if they blindly copy even the shortcuts it could be disaster. Better to be explicit.

  • @warherozer
    @warherozer 7 місяців тому +12

    precise and short , i love this.

  • @sebastiengross7849
    @sebastiengross7849 7 місяців тому +4

    at 5:00 you definitively should learn shell shortcuts: Esc-. (Escape followed by dot) which recalls the latest argument. Could save a lot of time ;-).

    • @Tutorialedge
      @Tutorialedge  7 місяців тому +4

      I try to generally avoid the shell shortcuts in some videos so that folks have a chance to copy what I’m doing.
      I usually either search through my command history or just cycle through my last commands when I’m trying to find a command. I hadn’t come across Esc-. though but thanks for sharing!

  • @0lange
    @0lange 7 місяців тому +4

    love it!
    Can you make a video on how to structure a go app and best pratices? For instance when you need logging, dependency injection, centralized error handeling and so on?

    • @Tutorialedge
      @Tutorialedge  7 місяців тому +2

      Great suggestions! I’ll add it to the list, I’ve covered some of these concepts in my courses but never on UA-cam!

  • @juscilan
    @juscilan 6 місяців тому +1

    I wanna migrate from gin-gonic to the standard library. Maybe it would be a great topic to approach on the channel.

  • @ma34529
    @ma34529 7 місяців тому +3

    I work in cybersecurity, dealing with automations, AWS lambdas, and CLI tooling. Does it make sense to transition to Go, or do I need a really compelling use case other than "it would be fun and better for my resume"?

    • @Tutorialedge
      @Tutorialedge  7 місяців тому +5

      The answer, as with most things in life, is it depends - Go is fantastic for building network applications and, if you're working in Cyber then that's likely going to be a huge part of it.
      It does currently run most of the interwebs due to it being the language that tools like Docker and Kubernetes are built in and there are a heck of a lot of start ups and tech companies that are actively trying to adopt Go.
      CircleCI for example has been actively pushing it's Go adoption for the past few years now and it's paying dividends with increased developer productivity.
      It does have a growing community and a thriving developer ecosystem so I would say it's definitely worth considering. I've been primarily a Go developer for the past 5 years now so it's served me very well in my career!

  • @jaimebondoza3710
    @jaimebondoza3710 2 місяці тому

    hahaha finally. damn. this should have been a feature ten years ago but i'll take it now thanks for letting us know

  • @CeriDavies1
    @CeriDavies1 Місяць тому +1

    Hi, I'm running Go 1.23, which I just updated to, and this syntax is not working "GET /comment" compiles but I get 404 Error, using the old style "/comment" works. I'm on a Mac. VS Code and bash are showing my go version as 1.23 (This may be a user error, could I be using an old net/http package?) I just looked at the documentation 1.22.2 and latest 1.23.0 for net/http, and they don't show this as a option. What am I missing?

    • @CeriDavies1
      @CeriDavies1 Місяць тому

      P.S. I love your style and how concise you are.

  • @dgaa1991
    @dgaa1991 4 місяці тому

    Have you found a way to handle CORS with the new syntax?

  • @kostais
    @kostais 7 місяців тому +1

    Thank you

  • @amer3h
    @amer3h 2 місяці тому

    Im new , which is best this one or gin or chi ?

  • @KaisELHADJMUSTAPHA
    @KaisELHADJMUSTAPHA 7 місяців тому

    I could basically build the same thing in express, what does GO add to the table ?

    • @Tutorialedge
      @Tutorialedge  7 місяців тому +3

      You certainly could - if you are more confident with express then I encourage you to continue using that for your projects.
      If you need better concurrency support, or perhaps higher performance servers with stronger typing then Go may be preferential in that scenario.
      As engineers, we should be picking the best languages and tools for the tasks at hand

    • @KaisELHADJMUSTAPHA
      @KaisELHADJMUSTAPHA 7 місяців тому

      @@Tutorialedge Yeah exactly, this is why I wanted to know if building simple APIs in GO could imrove stuff in comparison to doing so in express or python, thanks for the tips and the video, I will be diving more into GO :')

  • @DevlogBill
    @DevlogBill 5 місяців тому

    When you say this new update doesn't depend on 3rd party packages. Does that mean I don't need to use AXIOS for an SPA like React? I can use only the standard library? Still fairly new to programming so please excuse my ignorance, I've been looking at different backends to support my React project, Thanks for the video!

    • @steveo959
      @steveo959 4 місяці тому

      Hey what he means is that in the past in go to make routes with the standard library was cumbersome so they made it easier in the new update. So for your react you will still need things like axios to query the API in golang.

    • @DevlogBill
      @DevlogBill 4 місяці тому

      @@steveo959 Yea the other day I was reading the docs and I was disappointed that wasn't the case. BUT what you say makes sense I understood a portion of the updates from the docs, thanks for clarifying that for me.
      Still researching but now between FastAPI and Go.

    • @masterchief1520
      @masterchief1520 3 місяці тому

      ​@@DevlogBilltry go. It's really fun. It's so easy and it gives that performance for free. Ideology of sticking to standard ways is actually good as opposed to the shitshow in node

  • @SportsInfo.Official
    @SportsInfo.Official 7 місяців тому

    Hey can you tell which vscode theme are you using ?

  • @AchwaqKhalid
    @AchwaqKhalid 7 місяців тому +1

    Use a *BIGGER FONT* 💡

  • @tanmaylenka4024
    @tanmaylenka4024 3 місяці тому

  • @calebmarquart
    @calebmarquart 5 місяців тому

    Cool

  • @saucyalex
    @saucyalex 5 місяців тому

    Shit, looking at this whilst being Java dev makes me feel like I’m approaching new density 👀
    Btw I’m switching from Java to Go

    • @statuschannel8572
      @statuschannel8572 2 місяці тому +1

      Java!? you have already seen the worse, nothing will make you suffer than it! Welcome to the better side