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

  Рет қаралды 30,810

Tiago

Tiago

Күн бұрын

Пікірлер: 51
@TannerBarcelos
@TannerBarcelos 9 ай бұрын
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!
@TiagoTaquelim
@TiagoTaquelim 9 ай бұрын
Yee I feel the same! Thanks bro!
@afsdab
@afsdab 8 ай бұрын
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.
@gregorydaggett7444
@gregorydaggett7444 8 ай бұрын
hey me too! happy I found this channel
@herminio.machava
@herminio.machava 9 ай бұрын
Obrigado Tiago por mais um video incrível! Abraço de Moçambique!
@TiagoTaquelim
@TiagoTaquelim 9 ай бұрын
Obrigado eu!
@MattRobinsonDev
@MattRobinsonDev 9 ай бұрын
Another great video Tiago!
@liyang-ib6lk
@liyang-ib6lk 8 ай бұрын
The tutorial explanation is very clear and easy to learn! The style is also good!
@goncalofaraujo
@goncalofaraujo 8 ай бұрын
Very nice and useful tips. Thank you.
@de-is
@de-is 9 ай бұрын
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. :)))
@behzadayubifar8071
@behzadayubifar8071 5 ай бұрын
I really enjoyed. Waiting for more of your videos about implementing web services with just stlib
@prashlovessamosa
@prashlovessamosa 9 ай бұрын
Thanks for sharing buddy.
@nicknick65
@nicknick65 Ай бұрын
nice and clear
@Justanotherlurker69
@Justanotherlurker69 9 ай бұрын
Nice and clean. Thanks
@dawnrazor
@dawnrazor 5 ай бұрын
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
@marcelofeitoza3918
@marcelofeitoza3918 9 ай бұрын
Amazing content, helping a lot
@marcelofeitoza3918
@marcelofeitoza3918 9 ай бұрын
Obrigado pelo conteúdo, direto do Brasil! 🇧🇷
@TiagoTaquelim
@TiagoTaquelim 9 ай бұрын
@@marcelofeitoza3918 Muito obrigado Marcelo!
@BigBrainHacks
@BigBrainHacks 4 ай бұрын
Tia'-go', haha. Love your videos!
@TiagoTaquelim
@TiagoTaquelim 4 ай бұрын
🤣 never though of that
@gabriell7472
@gabriell7472 9 ай бұрын
Obrigado amigo! Very helpful :)
@ferasmnsha5583
@ferasmnsha5583 9 ай бұрын
can you please do a tutorial about using redis as a cache write-through in golang
@PhanorColl
@PhanorColl 9 ай бұрын
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?
@TiagoTaquelim
@TiagoTaquelim 9 ай бұрын
Try to change the endpoint handlers to the v1 the mux if that is not working. To handle multiple routing I would do the same as I did but then you need to do what I mention above. You could create an "adminRouter" and all of the admin handlers needed to be from that router.
@hsemix
@hsemix 9 ай бұрын
@@TiagoTaquelim Do you mean v1.HandleFunc("GET /users/{userID}", handler) coz that didn't work either
@liyang-ib6lk
@liyang-ib6lk 8 ай бұрын
I agree with you there.I ran the code for this video in my golan, but it does not match the results shown in the video. I am using the go version 1.22.1.The problem lies in the sub routing set by v1.I set the port to 8081.When I use curl -H "Authorization: Bearer token" localhost:8081/api/v1/users/23232 . The returned result is 404 page not found.What is the reason for this?
@liyang-ib6lk
@liyang-ib6lk 8 ай бұрын
@@TiagoTaquelim I have found the answer.This way of writing will have the same effect as in the video middleWareChain := MiddlewareChain(RequestLogMiddleware, RequestAuthMiddleware) childRouter := http.NewServeMux() childRouter.Handle("/api/v1/", http.StripPrefix("/api/v1", router)) server := http.Server{ Addr: s.addr, Handler: middleWareChain(childRouter), }
@addliam
@addliam 6 ай бұрын
@@liyang-ib6lk that code works
@shafiemukhre
@shafiemukhre 4 ай бұрын
good stuff, thank you!
@iamhexdd
@iamhexdd 6 ай бұрын
How can i automate documentation for my apis Tiago when using this approach instead of using other web frameworks?
@ferneutron
@ferneutron 4 ай бұрын
Great tutorial! Let's GO hahaha
@roshanpaudel6352
@roshanpaudel6352 7 ай бұрын
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.
@TiagoTaquelim
@TiagoTaquelim 7 ай бұрын
Thank you! I actually don't use vim. It looks like it because I made it so, but I'm just using the VSCode keybinds, I havent got the need to use VIM because I'm gotten pretty efficient with them. Here are the dotfiles: github.com/sikozonpc/dotfiles Not sure if they're 100% updated tho.
@roshanpaudel6352
@roshanpaudel6352 7 ай бұрын
@@TiagoTaquelim Thank you so much 😃
@Rundik
@Rundik 9 ай бұрын
If server fails to start it will still print the message that it has started
@saurontrollbrawl
@saurontrollbrawl 9 ай бұрын
Tnx man!
@fadygamilmahrousmasoud5863
@fadygamilmahrousmasoud5863 9 ай бұрын
Thank you
@OutdoorsWithMHM
@OutdoorsWithMHM 9 ай бұрын
Yes man!!!
@midnightraven4684
@midnightraven4684 2 ай бұрын
you sounds like chamber from valorant man, that's cool
@TiagoTaquelim
@TiagoTaquelim 2 ай бұрын
🤣🤣
@langqin
@langqin 8 ай бұрын
very helpful!
@bororobo3805
@bororobo3805 6 ай бұрын
What font and theme are you using?
@TiagoTaquelim
@TiagoTaquelim 6 ай бұрын
The theme is Gruvbox and font is Menlo
@bororobo3805
@bororobo3805 6 ай бұрын
@@TiagoTaquelim Which one? I see a lot in the extensions list
@TiagoTaquelim
@TiagoTaquelim 6 ай бұрын
@@bororobo3805 The one from jdinhlife
@madmaxdev
@madmaxdev 9 ай бұрын
What theme is this?
@TiagoTaquelim
@TiagoTaquelim 9 ай бұрын
Gruvbox.
@latakantsharma3134
@latakantsharma3134 5 ай бұрын
What's the theme broo??
@duropelado
@duropelado 9 ай бұрын
thanks for your content, but now I need to hardcode the method type? who designs this wtf haha
Authenticating your APIs in Golang (HTMX project)
32:22
Tiago
Рет қаралды 11 М.
This is your last video about Golang Structs!
15:57
Flo Woelki
Рет қаралды 10 М.
It works #beatbox #tiktok
00:34
BeatboxJCOP
Рет қаралды 41 МЛН
My scorpion was taken away from me 😢
00:55
TyphoonFast 5
Рет қаралды 2,7 МЛН
The standard library now has all you need for advanced routing in Go.
13:52
2024 gRPC Golang Tutorial - The tutorial I wish I had when I was learning
32:10
Golang Channels Or Wait Groups? Let Me Explain.
18:32
Anthony GG
Рет қаралды 27 М.
Level Up Your Golang: 5 Concepts You Need to know
19:22
Flo Woelki
Рет қаралды 15 М.
SQLc is the perfect tool for those who don't like ORMs
28:11
Dreams of Code
Рет қаралды 112 М.
Complete Backend API in Golang (JWT, MySQL & Tests)
1:37:57
Tiago
Рет қаралды 133 М.
THIS is the BEST Way to Write HTTP Services in Golang
13:53
Golang Project: Building a Secure Login Portal
10:39
Alex Mux
Рет қаралды 8 М.
Building Real-time Apps with Go | Azim Pulat
54:58
Azim Pulat
Рет қаралды 76 М.
The Secret Language Scaling WhatsApp and Discord
28:32
Theo - t3․gg
Рет қаралды 179 М.
It works #beatbox #tiktok
00:34
BeatboxJCOP
Рет қаралды 41 МЛН