The standard library now has all you need for advanced routing in Go.

  Рет қаралды 164,594

Dreams of Code

Dreams of Code

Күн бұрын

Пікірлер: 194
@dreamsofcode
@dreamsofcode 10 ай бұрын
Use my link sponsr.is/tld_dreamsofcode and code APPDEVFOO5 and get a .dev, .app, or .foo domain name for only $5!
@nyashachiroro2531
@nyashachiroro2531 10 ай бұрын
I can't explain just how good the quality of this video is. The Go team should just point to this video for anyone who needs to know about these routing patterns.
@esra_erimez
@esra_erimez Ай бұрын
Because the like button for this comment isn't enough: Well said
@inithinx
@inithinx 10 ай бұрын
Been learning go as my first proper language after c and java for my university degree. Go's a lot more fun.
@dreamsofcode
@dreamsofcode 10 ай бұрын
Go really is a lot of fun! I think it's simplicity and the power of the standard library help to make it so. You get to spend more time building and less time fighting the compiler or re implementing things.
@inithinx
@inithinx 10 ай бұрын
@@dreamsofcode I'm just glad I'm not doing extremely verbose object oriented stuff like I did in java. Oh and Go basically feels like c on steroids. The decision to not include header files in Go is awesome, coming from c.
@flannn6
@flannn6 10 ай бұрын
Welcome!
@Peshyy
@Peshyy 10 ай бұрын
Go 1.22 is such a blessing. And this video explains everything in such a clear and concise way, it definitely deserves more views and subscribers.
@orterves
@orterves 10 ай бұрын
As a long time C# Dev just now getting into Go, it seems I picked a very good time to get into Go.
@VictorVelazquezCid
@VictorVelazquezCid 10 ай бұрын
Same here. Typescript developer
@smnomad9276
@smnomad9276 10 ай бұрын
You'll be very surprised how simple and straightforward the language is for the kind of performance it offers. That is why Go is called a "boring language" lol.
@orterves
@orterves 10 ай бұрын
@@smnomad9276 these days I'm less concerned about performance and more concerned about developer productivity and code maintainability - luckily Go provides both!
@heldim92
@heldim92 8 ай бұрын
I am about to begin as well, still in doubt between Go and C#... Any insights?
@orterves
@orterves 8 ай бұрын
@heldim92 go wants to be simple - minimal hierarchy and interfaces, tests colocated with code, etc; c# wants to be formal - well-defined hierarchy with dependency injection, distinct test projects and separation of concerns. Both approaches can be productive and valuable; both approaches can be taken too far and cause issues. The right choice for any particular project comes down to business requirements, team knowledge and the deployment target and what features of the SDK and supporting ecosystem you have a need for. All that said, I think C# (especially now with .net 8) is fantastic - and yet my default these days for projects is Go.
@deado7282
@deado7282 10 ай бұрын
Thank you! I had the most annoying discussions with people who were like: "net/http has no middlewares we need to adopt a framework and 15 fancy libs bla bla". In the future ill just link this video & tell em to learn the basics (because I still don't feel like dealing with them in a overly constructive way)
@jeffreysmith9837
@jeffreysmith9837 9 ай бұрын
Using Stdlib in teams still sucks. Conventions are important in teams. No one wants to read 20 different implementations of boilerplate functions
@thisisreallyme3130
@thisisreallyme3130 8 ай бұрын
Teams having uniform conventions and coding styles IS very important. But embracing abstractions isn't the most straightforward way to solve THAT problem. In any case, this is kind of a beginner tutorial and in THAT context it wouldn't be responsible to sidestep the std lib and just embrace framework du jour. I appreciate that in production code with large teams and churn, one needs to compromise and just use what "most" people use.
@MohammadLsk
@MohammadLsk 10 ай бұрын
Thanks for the awesome content. Your videos are short but packed with valuable knowledge, which is more helpful than lengthy courses. Would love to see more Go programming videos from you.
@dreamsofcode
@dreamsofcode 10 ай бұрын
Thank you! I'm glad you enjoyed it! This certainly feels like the year of Go, and so I'll definitely be doing more content 😁
@h4ckedneko
@h4ckedneko 10 ай бұрын
The API is very similar to chi. It's like chi is now a part of the standard library, which is great. Although, it lacks centralized error handling like what in Fiber has managed to perfect.
@TheQxY
@TheQxY 9 ай бұрын
I hear this a lot, but I don't think it's such an issue. For small projects, centralised error handling is not really necessary. And for larger projects you can implement a middleware that wraps a handler func that returns an error, logs it, and returns an handler func that does not return an error in less than 10 lines of code.
@h4ckedneko
@h4ckedneko 9 ай бұрын
@@TheQxY That is what I do in our older projects that uses net/http + chi. I created my own custom handler signature which is close to http.Handler but it returns error. Then the wrapper will catch that error, logs it in Sentry if it's fatal, then creates an HTTP response for that error. Though once we migrated to Fiber, I never got to do all those boilerplates again because the handler signature in Fiber returns an error just like in my custom handler, and you only need to register an error handler function in the router for catching those errors, no more tedious wrapping. I agree that it's not necessary but it's convenient to have.
@lutherwaves6929
@lutherwaves6929 10 ай бұрын
Thanks @dreamsofcode for the video, really well explained! I actually managed to translate my whole go chi project into stdlib upon updating to 1.22 with the help of your video! One thing that caught my eye was during the demonstration of sub-routing, the v1 mux was initialized, but then the http.Server definition below still receives router as the Handler, instead of the v1 router. This did not work for me. I am either misunderstanding how this works, or there might be something unclear/incorrect in the video. Note that I am new to Go net/http. Would appreciate your feedback on this, so we can make it clearer for everyone!
@dreamsofcode
@dreamsofcode 10 ай бұрын
This might be a simple editing mistake! You'll want to pass the v1 router as the handler to the server! Apologies for that!
@lutherwaves6929
@lutherwaves6929 10 ай бұрын
Thanks for clarifying! Imposter syndrome picked me up as it didn't work for me 😅 Keep up the good work - awesome video!
@cryoexn7307
@cryoexn7307 2 ай бұрын
@dreamsofcode, could you please pin your response to this comment! I was following along with the video and ran into this also, it makes sense that we should pass v1 router instead of the original, but I wasn't sure if there was some fancy go magic that was supposed to be happening here Thank you for the amazing video!
@djanthony6662
@djanthony6662 10 ай бұрын
Coming from PHP & Laravel and just started playing around with Go 2 weeks ago and now I have this sweet video landed on my recommendation. I am so happy, I will stick to making quality Go + std lib videos in the future. Thank you, subbed!
@ja31ya
@ja31ya 10 ай бұрын
This was such an incredible wealth of information and it came at just the right time for me haha. Keep up the quality work!! This channel is slowly becoming invaluable to me as I'm learning Go.
@keshavakumar9828
@keshavakumar9828 10 ай бұрын
I really want to learn golang from you. the way you teach and express is so intuitive and natural. Please keep making more such videos
@CaffeineForCode
@CaffeineForCode 10 ай бұрын
Simply put, this is a masterpiece. Well done
@dreamsofcode
@dreamsofcode 10 ай бұрын
Thank you! I'm glad you enjoyed it!
@vercolit
@vercolit 10 ай бұрын
Simply POST
@joseph0x45
@joseph0x45 10 ай бұрын
@@vercolitsimply GET
@leffaq
@leffaq 10 ай бұрын
Damn I started learning golang 3 weeks ago and I already love it. Thank you for content!
@pavloburyanov5842
@pavloburyanov5842 6 ай бұрын
go language design is very simple and straightforward. Thanks for video!
@IllllIIllllI
@IllllIIllllI 10 ай бұрын
8:18 one thing to note is that creating a wrapper for ResponseWriter like this may cause some issues and performance problems, because most ResponseWriter implementations also have methods that are not part of the interface (like http.Flusher, http.Pusher or http.Hijacker, used for WebSocket connections). If you want a battle-tested RW wrapper, you should take a look at the Chi router's WrapWriter middleware.
@mfadhilal-fatih1427
@mfadhilal-fatih1427 6 ай бұрын
To use this its better to see how chi foe the things huh.. thank you sir
@ersia87
@ersia87 7 ай бұрын
Given the (excellent!) quality of this video I was hoping your channel was a Go focused channel teaching all the good design patterns to be used in Go. It would be SO valuable!!
@MarcOstrow
@MarcOstrow 5 ай бұрын
Thanks!
@dreamsofcode
@dreamsofcode 5 ай бұрын
Dude!!! Whattttttt thank you so much!!!
@dreamsofcode
@dreamsofcode 5 ай бұрын
Absolutely speechless ❤️❤️❤️
@JugglingGamer
@JugglingGamer 10 ай бұрын
Porkbun is awesome, it's cool to see them sponsor videos like these!
@younglion0451
@younglion0451 10 ай бұрын
Absolutely amazing! You've been inspired me to try go
@fakegermano
@fakegermano 10 ай бұрын
great video! quick tip: you can use a custom type as a key on context, this way there is no risk (due to type safety) of other packages accessing or overwriting your value
@DenDenn1
@DenDenn1 15 күн бұрын
This video is so awesome!! It helped me so much!! THANK YOU A THOUSAND TIMES
@RootsterAnon
@RootsterAnon 10 ай бұрын
Awesome video. I used Chi and was very happy with it but now I will try standard net/http.
@cinderwolf32
@cinderwolf32 7 ай бұрын
Calling out the multiple spaces thing was smart. I was already looking at the code on screen thinking it needed better alignment
@JerredWernke
@JerredWernke 10 ай бұрын
I think this is a really good video. I started using Gin for my current project that I'm working on. I only did this because it had clear documentation on how to test. Maybe if there were a video on how I could write tests for this stuff, I would definitely choose the standard library for the next project.
@ShimoriUta77
@ShimoriUta77 7 ай бұрын
Seems like this is the signal I needed for me to get into go.
@emptystuff1593
@emptystuff1593 10 ай бұрын
I'm learning Golang and creating some SSR website to apply it, and you literally covered every question I had. I was just done writing logging middleware when I was wondering how to pass information (request id and context to sqlc) downstream...
@aghileslounis
@aghileslounis 10 ай бұрын
The biggest reason I still use Echo, is for the middlewares they have available, especially for security, i don't need to write them or search for third party middlewares one by one I'm new to Golang, maybe there is a good pkg that handles all the security things i need, especially when using HTMX, security is very important since it's server side sending html
@bjni
@bjni 7 ай бұрын
this is so cool! im learning HTTP webservers in golang and the first example is something I needed LOL.
@roganl
@roganl 10 ай бұрын
Excellent Video. Lots of hand holding. I like it. However in spite of two cups of coffee in my system it felt "rushed" from a cadence perspective..
@dreamsofcode
@dreamsofcode 10 ай бұрын
Thank you for the feedback! It's tough to balance between keeping it engaging and concise whilst also ensuring it's understandable. I'll aim to do better in future;
@iwolfman37
@iwolfman37 10 ай бұрын
I simply use a switch statement to call the correct handler and use structures and their methods to pass middleware functionality. Like a structure with fields for a database connection and a custom logger. Then your handler method can just make calls to the structure's fields' methods.
@keertirajmalik
@keertirajmalik 4 ай бұрын
Found it at right time where I was doing simple CRUD project ❤
@krtirtho
@krtirtho 5 ай бұрын
It made realize how good gin is and how much time it saves. It kind of worked to motivate to use Gin more than ever before
@metaltyphoon
@metaltyphoon 10 ай бұрын
All I need now is for Go to add a way to know what StatusCode has been written by a middleware without having to wrap the ResponseWriter
@giovanni.tirloni
@giovanni.tirloni 10 ай бұрын
I appreciate the new visuals, they are pretty.cool, buy the stream of short phrases with filling space cut out feels like a Fireship video and I had trouble following it.
@hadadfadilah8636
@hadadfadilah8636 7 ай бұрын
Thank you so much , this will be a go to for me to write for my projects
@mela_nova
@mela_nova 10 ай бұрын
Top-notch information, thanks DoC
@arnoldwolfstein
@arnoldwolfstein Ай бұрын
great content. Thank you. also great to see Nvim.
@samifouad
@samifouad 3 ай бұрын
this video helped me ditch gorilla mux in an old project that I was reviving. Thanks!
@Dozer456123
@Dozer456123 10 ай бұрын
1:55 I think you could argue that because the wildcard is farther down the path specification, that path 1 is more specific than path 2.
@attilao
@attilao 10 ай бұрын
It seems a bit odd to download a private key… I'd rather generate one locally and request it to be signed. But then again, the goal here is simplicity I guess.
@duongphuhiep
@duongphuhiep 10 ай бұрын
as the std library extends, other frameworks / library will slowly die.. though I think it's natural.. Great content. it makes me want to have another try with go
@paw565
@paw565 10 ай бұрын
I would love to see a comparison with some framework. It's interesting if they are still really relevant.
@Fudmottin
@Fudmottin 10 ай бұрын
Pretty cool stuff. I definitely need to upgrade my typing skills!
@FloWoelki
@FloWoelki 10 ай бұрын
i really do love the standard library of go
@angkanchanda1801
@angkanchanda1801 8 ай бұрын
Loved this video. Simple and succinct!
@kurshadqaya1684
@kurshadqaya1684 9 ай бұрын
Man, this is so cool. Thank you!
@ThomasWSmith-wm5xn
@ThomasWSmith-wm5xn 7 ай бұрын
I appreciate this soooo so much. a wonderful video. Told me just enough to run with it.
@dreamsofcode
@dreamsofcode 7 ай бұрын
Glad to hear it!
@enz1222
@enz1222 10 ай бұрын
Top quality and clear explanations
@PhanorColl
@PhanorColl 10 ай бұрын
yes please, do a video on Certbot
@malikfajar4841
@malikfajar4841 9 ай бұрын
Nice video sir. I'm just learning golang, and this video is useful.
@souravlayek1662
@souravlayek1662 10 ай бұрын
Most needed video right now for me ❤
@AiratHalitov
@AiratHalitov 6 ай бұрын
Which IDE are you using? Thanks for video!
@Nadim-qk4sh
@Nadim-qk4sh Ай бұрын
thank you for the explanation and video nice how can i customly handle the not found and the method not allowed behaviour ?
@matthiashermsen9464
@matthiashermsen9464 10 ай бұрын
Thanks for your awesome content! Would you mind making a video about your distro setup ( I guess you are using Arch with some theming )
@birdofhermes6152
@birdofhermes6152 29 күн бұрын
Thanks. Very helpful.
@marlonmarcello
@marlonmarcello 2 ай бұрын
I am a few months late on this comment but, a tutorial for a complete backend of a simple twitter-type app using only the standard library would be awesome. I'd love to see how you would expand the examples here even further to include database connections and even some testing.
@hellelo.5840
@hellelo.5840 2 ай бұрын
You should add a GO playlist to your channel for ease of access.
@rogerramjet8395
@rogerramjet8395 10 ай бұрын
So weird hearing an Englishman pronounce "router" like the tool, or an American. (And "status", although many do, tbf.) Great videos though! And, about time, eh?! 👍👏
@dreamsofcode
@dreamsofcode 10 ай бұрын
Haha, believe it or not I'm actually British/American. I get the worst parts of both languages.
@crix_h3eadshotgg992
@crix_h3eadshotgg992 10 ай бұрын
@@dreamsofcode relatable
@rogerramjet8395
@rogerramjet8395 10 ай бұрын
lol @@dreamsofcode! You'd never know. You have a perfect "home-counties" accent. You could present the news for the BBC! Well, except for the American "router" pronunciation! They wouldn't have that! 😉😂
@awesomedavid2012
@awesomedavid2012 9 ай бұрын
I'm having a problem with the subrouting 10:45 The problem is that you cannot POST to "/" under the subrouter when you strip the prefix. The other routes work because there is no trailing slash, but suppose you want to POST to /v1 itself, there is no way to set up that route as far as I know. You can only set up /v1/ which is different, so http issues a redirect.
@ahmedb.hameed3330
@ahmedb.hameed3330 4 ай бұрын
I have also issues with subrouting. I thought it acts as a grouping but caused routes to return 301. Also not sure how to make multiple NewServeMux ? For me it does not work but I can't be so sure as I am a go noob.
@ahmedb.hameed3330
@ahmedb.hameed3330 4 ай бұрын
After long try and error, I managed it to work. Maybe that can help you. Note that nested subrouting can't be crouped in one string. I know it is stupid but at least can work like the example bellow by repeating few lines. route := http.NewServeMux() // Assets routes route.Handle("GET /css/", http.StripPrefix("/css/", http.FileServer(http.Dir("public/css")))) route.Handle("GET /js/", http.StripPrefix("/js/", http.FileServer(http.Dir("public/js")))) route.Handle("GET /images/", http.StripPrefix("/images/", http.FileServer(http.Dir("public/images")))) route.Handle("GET /audio/", http.StripPrefix("/audio/", http.FileServer(http.Dir("public/audio")))) // Pages API pageRoute := http.NewServeMux() pageRoute.HandleFunc("GET /", views.Home) pageRoute.HandleFunc("GET /auth/login", views.Login) pageRoute.HandleFunc("GET /live-reload", LiveReload.Run) // mux.HandleFunc("GET /*", views.Error500) // Public API route.HandleFunc("POST /register", AuthModule.SignUp) route.HandleFunc("POST /login", AuthModule.Login) route.HandleFunc("POST /verify-email", AuthModule.VerifyEmail) route.HandleFunc("GET /refresh-token", AuthModule.RefreshToken) route.HandleFunc("GET /logout", AuthModule.Logout) // Protected APIs route.HandleFunc("GET /me", middleware.Protected(AuthModule.Me)) route.HandleFunc("GET /admin/users", middleware.Protected(UserModule.ListUsers)) route.HandleFunc("GET /admin/users/{userId}", middleware.Protected(UserModule.GetUser)) route.HandleFunc("PUT /admin/users", middleware.Protected(UserModule.AdminUpdateUser)) mux := http.NewServeMux() mux.Handle("/", pageRoute) mux.Handle("/v1/", http.StripPrefix("/v1", route)) mux.Handle("/api/", http.StripPrefix("/api", mux)) // Register groups and routes // mux.RegisterGroups() APP_VERSION := services.Getenv("APP_VERSION") PORT := services.Getenv("SERVER_PORT") log.Printf(" \t✅ Server is listening to \t: localhost:%v \t✅ App version\t\t\t: %v ", PORT, APP_VERSION) http.ListenAndServe(":"+PORT, middlewareStack(mux))
@adyanf
@adyanf 10 ай бұрын
Love your content, great job!
@tewecske
@tewecske 5 ай бұрын
Great video! Thanks!
@krishnabharadwaj4715
@krishnabharadwaj4715 8 ай бұрын
9:00 why will a middleware have a status code? Status code is present when a response is returned, not during a middleware. 7:29 why is the import statement pointing to your GitHub if its included in the standard lib?
@dreamsofcode
@dreamsofcode 8 ай бұрын
1. Because you'll need access to the status code in order to log it out. 2. It's not pointing to my Github, that's the package path in the Go mod, it's a local dependency. The middleware package was created using standard library components.
@AbhisekPattnaik
@AbhisekPattnaik 2 күн бұрын
Use mkcert for certificate generation And use localhost mapping in hosts file for custom domain
@anthonycavagne4880
@anthonycavagne4880 10 ай бұрын
Hi ! Just one question here, why loop in inverse order in the create stack function ?
@dreamsofcode
@dreamsofcode 10 ай бұрын
Great question! This is so that the first element in the array acts as the top of the stack. The middleware isn't necessarily calling the next handler, more like wrapping each middleware inside. i.e. [a,b,c] needs to be a(b(c)) so it's easier to wrap it with a reverse iterator
@MattRobinsonDev
@MattRobinsonDev 10 ай бұрын
Excellent vid always!
@ashishgupta8394
@ashishgupta8394 5 ай бұрын
❤ amazing explanation
@ehl-12
@ehl-12 2 ай бұрын
Amazing video, thank you! I did have one question though: the `v1` subrouting is confusing me, because you do setup a new Muxer for it, but then you're not using that one as the handler to the `http.Server` -- it's still using the original `router`. Why does that work?
@PanicAtProduction
@PanicAtProduction 10 ай бұрын
Basically, you wrote your own framework. Behind the scenes, 3rd party libraries do the same thing that you said maybe more efficient in terms of complexity. I check real world benchmarks, crud operations, caching, https routing etc before I start a project. I didn't care this before, but when we receive the invoice from AWS, we can easily see it matters and worth it. You can handle thousand of operations in a small vps with go. It is impossible to handle same operations with JS(express or koi) under the same conditions.
@p.wagner3995
@p.wagner3995 10 ай бұрын
I dont want a CertBot vid, I want a LEGO (Letsencrypt-go) vid!
@jeremybuckets
@jeremybuckets 10 ай бұрын
11:22 it runs the middleware but it still creates the invoice. Is this just because you didn't actually implement auth for the demo, or what's going on there?
@thang1144
@thang1144 10 ай бұрын
at 10:00, what can we do if there are multiple stacks?
@danielgospodinow
@danielgospodinow 10 ай бұрын
11:13 - Can't/shouldn't we add this auth middleware not to `router` but to `adminRouter` instead? Since that way, we're adding admin-specific logic into the main router which doesn't seem ideal to me. And btw, fascinating content!
@dreamsofcode
@dreamsofcode 10 ай бұрын
It looks a little confusing, but basically we are doing that by wrapping the admin router only. It could have probably been explained a little easier if I added a /admin to that path!
@samifouad
@samifouad 3 ай бұрын
@@dreamsofcode what’s confusing about it is that it seems like the admin router has not been activated. I can see where we are wrapping middleware on it, but it seems like it’s inactive … but it actually is. I think it could be made clear with a stack that merges routers, similar to the stack that merges middleware. that way it’s very obvious we are also initializing the admin router.
@samifouad
@samifouad 3 ай бұрын
I ended up making a function that merges routers, works like a charm. clarifies that section much more so future me isn’t confused. 😄
@Strawberry_Htet
@Strawberry_Htet 10 ай бұрын
OMG, I learned a lot from this.
@joaovictorcesa9443
@joaovictorcesa9443 10 ай бұрын
Your videos are really good, I put you up there with Fireship. Keep it up.
@dreamsofcode
@dreamsofcode 10 ай бұрын
I'm honored. The man is a legend.
@srki22
@srki22 10 ай бұрын
@@dreamsofcode I found your channel because of Fireship channel. It's seems that people who follow Fireship also follow you so youtube suggested that to me as well. Nice channel.
@a0um
@a0um 6 ай бұрын
I keep liking the idea of paths without path variables using instead query parameters to pass any variable. The path becomes the name of a (sub) category of entities unpolluted of instance sourcing values. The query becomes the selector of the instance. Conceptually simpler IMO also method handlers specified at nested level avoid repetition because there is a one to many relationship between path and methods. Why not implementing middleware as a list of interfaces to be iterated over rather than nested calls?
@VardanPogosyan
@VardanPogosyan 3 ай бұрын
Which OS do you use? Could you also share your config for nvim, terminal?
@VardanPogosyan
@VardanPogosyan 3 ай бұрын
@dreamsofcode
@dejanduh2645
@dejanduh2645 10 ай бұрын
Should a new router be run in the main gorutine or should it be run in a separate gorutine for max performance?
@kaspariito
@kaspariito 10 ай бұрын
thanks, man!
@myanch200
@myanch200 10 ай бұрын
This is beautiful
@tonycheng1614
@tonycheng1614 9 ай бұрын
Given the updates of net package, is the framework like gin still necessary for some good reason?
@dreamsofcode
@dreamsofcode 9 ай бұрын
Gin does provide a lot of helper functionality to do things with less lines of code, but for me it breaks the contract with the standard library, so I prefer net/http.
@joelhowell5402
@joelhowell5402 10 ай бұрын
I would pay for classes from this guy
@guitaripod
@guitaripod 10 ай бұрын
You can super thanks the video, unless you're all talk of course
@ashiqnuaiman
@ashiqnuaiman 7 ай бұрын
A question, Is the `net/http` package in Go 1.22 fully capable of replacing the Gin framework?
@dreamsofcode
@dreamsofcode 7 ай бұрын
It is
@Jake-bh1hm
@Jake-bh1hm 9 ай бұрын
Question: Is there a framework for GO that is like svelt? Or svelte like?
@dreamsofcode
@dreamsofcode 9 ай бұрын
The closest thing would be Templ, but it's still rendered on the server rather than rendered on the client.
@phenvrc
@phenvrc 9 ай бұрын
Hey, which mic are you using? I loved the sound quality
@dreamsofcode
@dreamsofcode 9 ай бұрын
Thank you! I use the Sennheiser MKH 50. It's a really great mic but not cheap.
@CarlosNexans
@CarlosNexans 3 ай бұрын
What is that color theme and font family? I need it.
@gg-gn3re
@gg-gn3re 3 ай бұрын
idk the font or the theme but a theme that is similar is tokyonight. the editor is neovim. Unfortunately there are probably a thousand themes and dozens that are similar lol
@AlexandruVladutu
@AlexandruVladutu 9 ай бұрын
The trick with wrapping the ReponseWriter to get the statusCode fails with stackoverflow if using the "/v1" Handle func that strips the prefix. Try that scenario with /v1/ and without in the path and you'll see the app crashing.
@dreamsofcode
@dreamsofcode 9 ай бұрын
Hmm, I just tested this and couldn't get it to crash. http.StripPrefix only affects the request, not the response. If you're on discord (or anywhere else), mind sharing your code with me so I can take a look?
@Novascrub
@Novascrub 5 ай бұрын
"If you do it like this, your code will start to look like lisp, so instead..." proceeds to implement a damn trampoline.
@AntonioPaezL
@AntonioPaezL 8 ай бұрын
Great video ...but disscount coupon is not working
@rudde7251
@rudde7251 10 ай бұрын
Does the other libraries like, echo, go, chi, mux use net/http, or are they all a complete reimplementation of http in go?
@dreamsofcode
@dreamsofcode 10 ай бұрын
Some use a lot of the net/http package underneath. I believe chi has it's own router implementation internally.
@bijayaprasadkuikel5162
@bijayaprasadkuikel5162 10 ай бұрын
Please make a video on certbot. I really want to see a full Microservices code in go from scratch to production. Please make it happen.
@dreamsofcode
@dreamsofcode 10 ай бұрын
I am working on a course looking exactly at this!
@bijayaprasadkuikel5162
@bijayaprasadkuikel5162 10 ай бұрын
@@dreamsofcode i would be really really happy. Your contents are out of the world.
@rahulagarwal968
@rahulagarwal968 10 ай бұрын
Hi. If I have to implement a monthly or yearly subscription model for my mobile application. Then is it mandatory to use In-App-Purchases ? I mean we cannot use an external payment gateway. How Netflix is redirecting users to its website to avoid 30% fees. Please talk about this.
@ahmadjunaidi21-l6l
@ahmadjunaidi21-l6l 7 ай бұрын
yoo this is insanee
@lilzin69
@lilzin69 10 ай бұрын
8:58 would be a nice PR
@tbranch227
@tbranch227 10 ай бұрын
hey look, go is finally maturing to the level of all the web stacks that came before it....
@pettymanny6487
@pettymanny6487 10 ай бұрын
Useful, TX
@blackaccel
@blackaccel 9 ай бұрын
Dream how to I get to use my terminal with those numbers 1.Nvim, 2.Proyect, I’m using I term on Mac and using nvim as my editor also
@Nonsense116
@Nonsense116 10 ай бұрын
brb upgrading my side project to go 1.22 and migrating away from gin.
@mubasherusman3943
@mubasherusman3943 11 күн бұрын
is it as fast as fastHttp or fiber ?
@dicmaster2697
@dicmaster2697 10 ай бұрын
very good video
Setting up a production ready VPS is a lot easier than I thought.
29:50
Five of my favorite project ideas to learn Go.
11:31
Dreams of Code
Рет қаралды 107 М.
UFC 310 : Рахмонов VS Мачадо Гэрри
05:00
Setanta Sports UFC
Рет қаралды 1,2 МЛН
Don’t Choose The Wrong Box 😱
00:41
Topper Guild
Рет қаралды 62 МЛН
This is your last video about Golang Structs!
15:57
Flo Woelki
Рет қаралды 14 М.
Пишем REST API сервис на Go - УЛЬТИМАТИВНЫЙ гайд
2:57:51
Николай Тузов — Golang
Рет қаралды 159 М.
Network automation with YANG and Python is a reality
42:46
Roman Dodin
Рет қаралды 419
Function Iterators might just change the way we write loops in Go
11:35
Gamedev in Zig is actually pretty good...
16:28
Coding with Sphere
Рет қаралды 24 М.
The Most Efficient Struct Configuration Pattern For Golang
11:10
Hacking This Terrible DRM
15:20
Nathan Baggs
Рет қаралды 122 М.
UFC 310 : Рахмонов VS Мачадо Гэрри
05:00
Setanta Sports UFC
Рет қаралды 1,2 МЛН