How to create your Golang APIs from now on with v1.22

preview_player
Показать описание
Since Go 1.22 released you can now build your API services with just the net/http package, without the need for any external packages likes gorilla/mux, fiber or chi.
So in this video I’ll show you how I’m going to be building my APIs from now on with go 1.22.

📢 We're building a Discord community, come and join

Hope you liked and thanks for watching!

🙋🏼‍♂️ Socials:

#golang #api #backend

Time Stamps 👇
00:00:00 Intro
00:01:08 API server
00:03:00 Path values from request
00:03:45 Method based routing
00:05:53 Middleware
00:11:21 Subrouting

Video titles ideas (for the algo):
What is new in Golang 1.22
How to build REST API in Golang 1.22
Create API in Golang 1.22
Рекомендации по теме
Комментарии
Автор

I love the Echo framework, but for a very basic REST API or for learning Go and the stdlib, these new 1.22 updates for http, and Go itself make learning really good. Awesome video. As a TS dev, I am so used to reaching for libraries, but Go is so simple and elegant, you almost don't need to ever reach outside the stdlib 90% of the time. I can see why folks will reach for a router beyond the native one, though, because it definitely does abstract a few things away like creating a new mux for another router, stripping prefixes and defining the method in the route path. Enjoy your content brother, keep it up!

TannerBarcelos
Автор

Great Video, I'm learning Go and I'm trying to use stdlib before trying any external library, your videos are helping me with this.

afsdab
Автор

The tutorial explanation is very clear and easy to learn! The style is also good!

liyang-iblk
Автор

Obrigado Tiago por mais um video incrível! Abraço de Moçambique!

herminio.machava
Автор

I really enjoyed.
Waiting for more of your videos about implementing web services with just stlib

behzadayubifar
Автор

Again, thanks for the great work. very motivational, and helps me to move forward.
I hope in your next video you are going to explain the "Functional Options" pattern you have used for "Middleware Chaining". Coz in this video you have just quietly typed it. :)))

de-is
Автор

Hey good video. The only nitpicking point I would make is when you implement the middleware with a for loop with a complicated reverse iterator when all you needed to do is use a straight forward for range statement and assume that the middlewares passed in are defined in the reverse order. That way you can avoid that unnecessary reverse logic

dawnrazor
Автор

can you please do a tutorial about using redis as a cache write-through in golang

ferasmnsha
Автор

Tia'-go', haha. Love your videos!

BigBrainHacks
Автор

you sounds like chamber from valorant man, that's cool

midnightraven
Автор

Hi boss, I love your go content. I usually watch you and you use vim/nvim in your vscode with ease. I am a fulltime nvim user and I struggle to navigate around vscode even though using nvim extension. I love the way you navigate around. I looked at the description I couldn't find your github. Would you be able to share your vscode configs. I would love to implement it.
Thank you for your awesome content.

roshanpaudel
Автор

If server fails to start it will still print the message that it has started

Rundik
Автор

for sub-routing, did you change the handler in the server to V1, or left the router, I tried it, if I leave Handler: router, it does not take effect, if I change it fo Handler: v1, it takes effect, how would you handle multiple subrouting?

PhanorColl
Автор

How can i automate documentation for my apis Tiago when using this approach instead of using other web frameworks?

iamhexdd
Автор

thanks for your content, but now I need to hardcode the method type? who designs this wtf haha

duropelado