I hope you all enjoyed this video! I love Go and I love all the Go backend services. If you enjoyed this video - please consider liking and subscribing. It means the world to me :)
heeey, love your vids, thanks man! video suggestion for you: tell your story, how you learned to code, school, college, first job, bad jobs, good jobs... I'd really like it
industry looking for a good framework with go. As framework always come up with best outline practices, code maintainability, etc. but thanks for clearing up my confusion... 🙂
Important caveat is that Fiber doesn’t use net/http. That one goes against your point about advocating for the standard library. It is a great library regardless, but it brings in some of the JS abstractions with it trying to replicate Express in Go. Found this out the hard way when troubleshooting and growing my project. With the other frameworks, there were more adaptable modules and associated docs. Mostly because they are closer to net/http with true support of the http response interfaces.
I use golang to not have to use javascript/js framework syntax... lol, any library that tries to replicate that automatically goes into the recycling bin.
"JavaScript framework syntax" is too broad. Which framework are we talking about? And whether it's a JS inspired framework or otherwise, it's a framework-An additional layer of abstraction- built on top of a language, in this case, go. @@depralexcrimson
The node devs are bringing their "javascript problem" with them to go frameworks with Fiber and Echo. Just use chi (which actually uses the std lib handler interface) and learn the go paradigms.
i was using gin and echo i was building small projects and was not enjoying it, then changed to chi and i love it now i cant stop pushing myself to limits currently building a social media app backend in chi
Exactly. JavaScript devs are so afraid of writing code. They just want a framework to give them a cute API that abstracts most of the programming away from them.
Both Chi and httprouter are routers, not frameworks. For anything other than routing you will need to bring in whatever you need/want. Gin/Echo/Fiber provide things beyond routing. You can't put them into the same category. Also httprouter isn't the closest to the std. library. What makes you think so? Look at the handler signature alone. httprouter literally provides adapters to be compatible with the std. interface. Chi doesn't require that. Just wanted to clear things up a bit, as i found this video a bit misleading....
@@HypothesisI i honestly can't tell, as i don't really have a preference. I personally used only a router (chi or whatever...) for most of my projects. On the other hand something like Gin is really really convenient, if you want a bit less re-inventing the wheel. Fiber... i'm on the fence about. It's based on fasthttp, which leads to being rather incompatible with the std. lib. I'm not sure if the speed alone is justification enough. It has other good features though. If you want to understand your options better, the best thing you can do is use them. Play around with them. And not listening to a wild hobo like me ;-).
Yeah, when we started using Go in our company, we used did what we did in the Node world: "Best web-framework for Go" and we got Gin as a result. It was a pleasure to work with. Until it didn't. We needed a feature that Gin couldn't provide at that time. We had to rip it out and use a different library because our Code was too dependent on Gin. It took a weak to rewrite all parts to remove Gin from our Codebase. This wouldn't have happened if we used std lib compliant handlers from the very beginning. Since then being not compatible with the std lib became a deal breaker for us. Actually, I tried Fiber for a smaller project, since it claims to be much faster than the std lib. That may be so. I never had the opportunity to fully test it. I did have to give up on the custom web utils, since they're not compatible with fiber. But Fiber comes with a client too. And I needed to send multiple requests to multiple JSON endpoints at the same time and then merge the results together. Yeah, it didn't work too well. No matter what I tried, it never really turned out okay. WaitGroups, channels ... you name it (and each goroutine created it's own client to boot). It worked during the testing, but failed in production. Had to rip it out and replace it with std lib HTTP Clients. Did it become slower? Yes. But not enough to justify unstable results (those should be deal breakers anyway, we're past the MongoDB era).
most of his videos are, other times they feel and are not actually, but most of time knowledgable people like you comment and clearify things for everyone , ty ex: goroutine video, (spoilers they make green threads for anyone wondering)
I have used gin for all of my professional go microservices, it works really well. Middlewares and route grouping are the features I use most often. It has enough community support and its much faster than the standard library as per the benchmarks.
I love Chi for that, its just a router built to work with the standard library. Simple and powerfull. I tried Fiber recently and you need to put a little more work to keep an idiomatic codebase but the performance off the server it brings are really nice at first glance.
Just for fun, I am putting together a framework mainly using Standard Library, I've already created database migrations, seeder, route, middleware, authorization, authentication. Simplified controllers, depending what you return, struct, map, string, view or error. It will automatically render json, HTML, or returns error status code. It also has dependency injection, you can map your dependencies, and just type hint the interface where and will be automatically resolved in your controller or middleware. It has HTML views, Caching, Locally stored session data, choice of file, redis, memcache, different databases and so on. Models, SQL Builder. Fun to put it together, maybe I'll never use it for a real project, but who knows.
I started javascript and php vanilla. I believe with both, it is easily possible to write evertyhing you want with it. I mean... the frameworks and libraries are build using that same language..... I see a lot of people using packages, frameworks or libraries, and not understanding how they work under the hood As soon as you create a vanilla construct, they look at you like it's dirty, ugly code, but they dont see that the tools they are using function the exact same way, but prettified with a wrapper function. I like go. the ease on how you can set up allmost every tool you like is great( Although... string manipulation is still a challenging concept in golang for me :P) The most important things are already under your fingertips, accessible without any configuring a framework or bundler. With some extra lines of code, you can easy write the "luxery" that frameworks offer you.
@@packratrust ...and this is why we have abominations like React. I guess not everyone can be professional then; someone has to do the dirty work of actually making the stuff work beneath the 40 layers of abstraction for the script kiddies.
@@ForeverZer0 funny seems like most react haters are so far from frontend and don't know anything about react, what 40 layers, react is dead simple small library, you have js functions that return layout, that's it. If you are thinking it's more professional to write vanilla js and reinvent the wheel for each thing, then i just feel sorry for ppl who will support this mess after you and for time wasted by writing same thing over and over. Maybe you should write your frontend in asm then, it's the only none script real language there.
@@ForeverZer0that's why I always use VanillaJS. I used to develop using JS frameworks, the company had many projects in maintainance... And after 2 years the nightmare begun: Almost 90% of all projects couldn't run locally, just because of outdated dependencies. We didn't touch ANYTHING in years, it just stopped working. We were a small team, so maintainance phase is TOO important for us. That's why, with a lot of effort, we migrate all to VanillaJS. And now, maintenance is 0, because we have 0 dependencies. It took a long time to build our "perfect" html/css/js templates, but it's something you do once, and you use it forever. While frameworks will always suffer in the maintainance phase, specially when having many projects.
Once you've built a CRUD app with the stdlib you'll see that these routers don't really offer much outside of a sprinkle of syntactic sugar. That isn't to say you shouldn't use them, but I think it's well worth a few hours using only the stdllib and seeing what you can do with it (everything).
If I’m not using the std library with mux routing, I just gin. I’m moving toward htmx and gin’s ShouldBind method does some beautiful field validation for form data.
That's true, I make mainly backend applications with typescript and node. And for my "degree" (IDK how to say that but I mean that I'm still studying) we are using java and OMG I love the standard library of go and their type system design. The "low level" control that go gives to you for some things. Their simplicity and the tools that come with the language is amazing. Personally I use fiber but because I have chosen to work with it thanks to the "Express inspired" tag, and it works for me and I learned how to use it, so I will keep using it.
To be fair, I stopped caring about frameworks and their "wars". Until they are well maintained, easy to use and follow the "standard" pattern (so I don't spend more time to learn it, rather implement it from zero) I'm down to any of them... Oh, almost forgot! Have a proper jwt handling system! The only thing that matters for me, if I don't have to touch the ready code in the following few months for the fault of the framework.
I am looking to migrate from NestJS. There main feature I am looking for is having a way to expose types and generate Open API. What is the closest to the standard library I can use?
This was helpful thanks. I'm just starting to learn go and trying to get the lay of the land. One of the questions i had was, do I even need a framework?
Hi So I tried Chi v5 and Fiber v3 to build somewhat similar create user application just to test it out. Complexity wise it was more or less same, no major issue. The only difference I felt was in response time. For me chi was able to give the response back in close to half the time fiber was taking. I am not sure if that is always the case coz I have just recently start go so I might have skipped out on few things. Anyways out of chi and fiber which one in general would be a better choice?
I use Go Fiber since it reminded me of FastAPI/Express and I get so much hate for it on Reddit like I kicked a puppy since it uses the fasthttp router. I promised myself that as soon HTTP3 with UDP becomes a thing I'll convert away from Fiber which is easy since all frameworks are roughly the same implementation. Is using Fiber really that big of a cosmic sin?
Nope. Choose the right tool for the job. Good performance? An API that makes you productive? Sall good. Chose it for a project in work involving migrating Python microservices to Go. It worked out great.
That's why I love python ecosystem so much when it comes to web frameworks. All inclusive? Django. Rest API with some freedom? FastAPI. Total freedom? Flask. All these have their use cases and serve a purpose. In go I feel that everything is almost the same and there are no clear benefits to using one tool over the other. I guess given some time they will "split" at some point.
I don't use Go that often, just for small side projects here and there, and I rarely see a need for bringing in a third party dependency for most things. The only thing I wish was in the std lib http router is support for url parameters like `/users/:id`. If it had that, it would be amazing, although it is very good already
Haven't tried yet, but that should be out now in Go 1.22. Previously I've used gorilla/mux for some basic routing with variables, otherwise just plain bog standard http.HandlerFunc.
@@HenriqueNewsted vercel does have a runtime for GO but the docs don't help much, i tried yesterday just copying the hello world example they have and not even that worked...
@@vicentebravocabezas yeah I think the .mod and .sum files have to be at the root of the project and the main.go file gotta be inside the api folder (talking about a nextjs project)
Yep, made a server just using the standard library. Granted I had some LLM hints but overall it ended not looking and being that much more complicated than Gin… like all you need is a switch statement for the rest methods for routing, etc
I DID follow the path you recommended. I went the purist standard library path. Then my projects grew more complex and I ended up trying to write MY OWN PRIVATE framework just for this project, re-inventing the wheels of Chi, Echo, Gin and Fiber! I was so proud NOT to import modules and frameworks. Today I know that THAT was a waste of time! My project took 6 months to let's say ... take shape. With a framework I would have done it in 6 weeks! So my advice today is: If you want to get things done, DO use a framework, and then DO study the source code of your framework to understand how it works and why it works the way it does. The debugger is your best friend here.
I like go's extensive standard library but I still believe frameworks is making developers life easier. They abstract things and help you to move faster. when you are writing your own saas application (depending on domain) most of the time you are not interested whats going on under the hood you are interested how fast I can move my mvp and do marketting etc
Go is meant to be simple, straightforward and productive. Many people that comes from other languages struggles with this difference and start looking for frameworks and libraries for everything. This language is very easy to adopt and will turn you into an expert programmer very quickly.
I’d rather trust go team than 3rd party libs developers in security matters. No one develops from scratch as we’ve already got rich net/http. This sets go apart from other languages: you don’t need so many external dependencies to build web apps. For example, beloved Rust: it has absolutely nothing out of the box, and to make even the simplest web app you need to add a list of crates, and be familiar with their apis that don’t follow any common rules and vary greatly from one to another.
i LOOOOOVE the httprouter, using this in production at massive scales and it‘s just awesome. This is literally what the go default router should actually be!
Go doesn't need frameworks. Never did. You pick nice modules that fits into your requirements, so your application becomes "a framework". And that is exactly what makes everything great.
Hey Melkey. Might be out of context for this particular video, but can do a video showcasing how and when you use queues, tools like rabbitmq in Golang (programming in general)? 🥹
Thanks bro, this was good learning for me. Although my current needs simply don't require anything other than Python and maybe a bit of SQL/HTML, maybe one day I might need a better tool.
not everyone has to do everything from scratch. there are useful middleware provided with the frameworks. its better to learn everything from scratch if you are a beginner but not everyone has the time to implement already existing middleware and other utility functions provided by third party libraries
As someone migrating to Go, the biggest problem I see in community is not over-engineering, but under-engineering. A lot of Go developers try to build everything from scratch, which increses the lead time of projects, specially if you work with microservices. And every new thing you need, you need to build by yourself. What's wrong with using libraries and frameworks? Answer: nothing, it's about choosing your fights. How many security breachs are we deploying just for the sake of "use the std lib". Under-engineering is a problem just as big as over-engineering. But sure, let's be purists, what could go wrong? zzzzzz
it's funny how the definition of a framework differs from PHP to any other language in PHP you have a lot of boiler plate already preset that cover logic you find in at least 80% of cases and you don't want to waste time setting them up, BASSICALLY USING THE "REUSE" WORD TO THE MAX in other languages you pretty much just have a small wrapper over the basic language, i think most of the time you will waste writing documentation for what does what in each directory
there is something real about frameworks If you pay close attention to them and how they work, you forget to become a real programmer in your language, for the loss of time that this requires. It is better to learn the language well and make your own environment.
Omegachads just use the standard lib bruh. Im about done with the basic version of my first web server with some authentication. Im sure once i turn it into a big project, ill eat the crow.
A bit superficial analysis. Obviously if you just look at the core basic functionality, they all look the same. But if you dive a bit deeper you will start noticing clear and important differences among those tools
I use chi. I secretly think videos like this are slight unhelpful bc someone coming from python,java, js really should be given an answer... strengths of each...and then you should explain why it doesn't matter and how thin they are and why go is different.... I say this because I don't think the std lib message lands until they've dived into programming go, usually using chi or something...Just my opinion - great vid! Edit: and i only say this bc i just lived this lol
All of them are just routers with some middleware functionality and some of them use "framework" keyword just because of newcomers coming from JavaScript :)
I hope you all enjoyed this video!
I love Go and I love all the Go backend services.
If you enjoyed this video - please consider liking and subscribing. It means the world to me :)
heeey, love your vids, thanks man!
video suggestion for you: tell your story, how you learned to code, school, college, first job, bad jobs, good jobs...
I'd really like it
industry looking for a good framework with go. As framework always come up with best outline practices, code maintainability, etc. but thanks for clearing up my confusion... 🙂
Great video, but why you did not include links in the description?
Important caveat is that Fiber doesn’t use net/http. That one goes against your point about advocating for the standard library. It is a great library regardless, but it brings in some of the JS abstractions with it trying to replicate Express in Go.
Found this out the hard way when troubleshooting and growing my project. With the other frameworks, there were more adaptable modules and associated docs. Mostly because they are closer to net/http with true support of the http response interfaces.
I use golang to not have to use javascript/js framework syntax... lol, any library that tries to replicate that automatically goes into the recycling bin.
"JavaScript framework syntax" is too broad. Which framework are we talking about? And whether it's a JS inspired framework or otherwise, it's a framework-An additional layer of abstraction- built on top of a language, in this case, go. @@depralexcrimson
The node devs are bringing their "javascript problem" with them to go frameworks with Fiber and Echo. Just use chi (which actually uses the std lib handler interface) and learn the go paradigms.
Depends on the project. Always. There is no gate to keep here.
i was using gin and echo i was building small projects and was not enjoying it, then changed to chi and i love it now i cant stop pushing myself to limits currently building a social media app backend in chi
Exactly. JavaScript devs are so afraid of writing code. They just want a framework to give them a cute API that abstracts most of the programming away from them.
The best Go framework is: no framework (?)
@@hamm8934as a JavaScript dev i confirmed this
Vulpix really made me giggle, not gonna lie.
Oh HEY!
YOU MAKE REALLY GOOD GO VIDEOS!
Both Chi and httprouter are routers, not frameworks. For anything other than routing you will need to bring in whatever you need/want. Gin/Echo/Fiber provide things beyond routing. You can't put them into the same category. Also httprouter isn't the closest to the std. library. What makes you think so? Look at the handler signature alone. httprouter literally provides adapters to be compatible with the std. interface. Chi doesn't require that.
Just wanted to clear things up a bit, as i found this video a bit misleading....
Of echo/ gin/ fiber which do you prefer? I've been using chi for a few weeks and like it but want to understand my options better
@@HypothesisI i honestly can't tell, as i don't really have a preference. I personally used only a router (chi or whatever...) for most of my projects. On the other hand something like Gin is really really convenient, if you want a bit less re-inventing the wheel. Fiber... i'm on the fence about. It's based on fasthttp, which leads to being rather incompatible with the std. lib. I'm not sure if the speed alone is justification enough. It has other good features though.
If you want to understand your options better, the best thing you can do is use them. Play around with them. And not listening to a wild hobo like me ;-).
Yeah, when we started using Go in our company, we used did what we did in the Node world: "Best web-framework for Go" and we got Gin as a result. It was a pleasure to work with. Until it didn't. We needed a feature that Gin couldn't provide at that time.
We had to rip it out and use a different library because our Code was too dependent on Gin. It took a weak to rewrite all parts to remove Gin from our Codebase. This wouldn't have happened if we used std lib compliant handlers from the very beginning. Since then being not compatible with the std lib became a deal breaker for us.
Actually, I tried Fiber for a smaller project, since it claims to be much faster than the std lib. That may be so. I never had the opportunity to fully test it. I did have to give up on the custom web utils, since they're not compatible with fiber.
But Fiber comes with a client too. And I needed to send multiple requests to multiple JSON endpoints at the same time and then merge the results together. Yeah, it didn't work too well. No matter what I tried, it never really turned out okay. WaitGroups, channels ... you name it (and each goroutine created it's own client to boot).
It worked during the testing, but failed in production. Had to rip it out and replace it with std lib HTTP Clients. Did it become slower? Yes. But not enough to justify unstable results (those should be deal breakers anyway, we're past the MongoDB era).
most of his videos are, other times they feel and are not actually, but most of time knowledgable people like you comment and clearify things for everyone , ty
ex: goroutine video, (spoilers they make green threads for anyone wondering)
I have used gin for all of my professional go microservices, it works really well. Middlewares and route grouping are the features I use most often. It has enough community support and its much faster than the standard library as per the benchmarks.
Gin is great. I love Chi personally
You wrote that you used gin but gin is slower than fiber why did not you use fiber instead gin?
I like the simplicity and the community gin offers. Also the performance improvement wasn't big enough to make the switch.
I love Chi for that, its just a router built to work with the standard library. Simple and powerfull. I tried Fiber recently and you need to put a little more work to keep an idiomatic codebase but the performance off the server it brings are really nice at first glance.
in most cases, Fiber is more than enough. crazy fast and easy to learn and use. 🚀
Boom!
Just for fun, I am putting together a framework mainly using Standard Library, I've already created database migrations, seeder, route, middleware, authorization, authentication. Simplified controllers, depending what you return, struct, map, string, view or error. It will automatically render json, HTML, or returns error status code. It also has dependency injection, you can map your dependencies, and just type hint the interface where and will be automatically resolved in your controller or middleware. It has HTML views, Caching, Locally stored session data, choice of file, redis, memcache, different databases and so on. Models, SQL Builder. Fun to put it together, maybe I'll never use it for a real project, but who knows.
At this rate, you should build your own backend framework to compete
YO SHOULD I ?!?!?!?!?
DONT TEMP ME LEWIS
I started javascript and php vanilla.
I believe with both, it is easily possible to write evertyhing you want with it.
I mean... the frameworks and libraries are build using that same language.....
I see a lot of people using packages, frameworks or libraries, and not understanding how they work under the hood
As soon as you create a vanilla construct, they look at you like it's dirty, ugly code, but they dont see that the tools they are using function the exact same way, but prettified with a wrapper function.
I like go. the ease on how you can set up allmost every tool you like is great( Although... string manipulation is still a challenging concept in golang for me :P)
The most important things are already under your fingertips, accessible without any configuring a framework or bundler.
With some extra lines of code, you can easy write the "luxery" that frameworks offer you.
no professional wants to waste their time recreating the wheel
@@packratrust ...and this is why we have abominations like React. I guess not everyone can be professional then; someone has to do the dirty work of actually making the stuff work beneath the 40 layers of abstraction for the script kiddies.
@@ForeverZer0 funny seems like most react haters are so far from frontend and don't know anything about react, what 40 layers, react is dead simple small library, you have js functions that return layout, that's it. If you are thinking it's more professional to write vanilla js and reinvent the wheel for each thing, then i just feel sorry for ppl who will support this mess after you and for time wasted by writing same thing over and over. Maybe you should write your frontend in asm then, it's the only none script real language there.
@@ForeverZer0that's why I always use VanillaJS. I used to develop using JS frameworks, the company had many projects in maintainance... And after 2 years the nightmare begun:
Almost 90% of all projects couldn't run locally, just because of outdated dependencies. We didn't touch ANYTHING in years, it just stopped working.
We were a small team, so maintainance phase is TOO important for us.
That's why, with a lot of effort, we migrate all to VanillaJS. And now, maintenance is 0, because we have 0 dependencies.
It took a long time to build our "perfect" html/css/js templates, but it's something you do once, and you use it forever.
While frameworks will always suffer in the maintainance phase, specially when having many projects.
Once you've built a CRUD app with the stdlib you'll see that these routers don't really offer much outside of a sprinkle of syntactic sugar. That isn't to say you shouldn't use them, but I think it's well worth a few hours using only the stdllib and seeing what you can do with it (everything).
The same opinion
1:08 you fixed the sound effect volume. amazing. thanks man
Glad to hear!
After Go 1.22 we'd use any framework?
Used Gin, would use it again. Reminds me of Express, and to me Express is almost perfect backend framework :)
Great to hear!
I really like chi, and yes! it's the closest to the standard library
me too brotha
2:25, by that logic you can pick any of frontend frameworks in most cases. They also do the same thing: neat wrapper on top of js
Fiber, then used echo primarily cause of pocketbase but will have to get stdlib a shot on my next go around.
If I’m not using the std library with mux routing, I just gin.
I’m moving toward htmx and gin’s ShouldBind method does some beautiful field validation for form data.
I gotta check it out
Love the channel!
A little correction- actually the ones based on fasthttp e.g. fiber are not based on http core go library!
That's true, I make mainly backend applications with typescript and node. And for my "degree" (IDK how to say that but I mean that I'm still studying) we are using java and OMG I love the standard library of go and their type system design. The "low level" control that go gives to you for some things. Their simplicity and the tools that come with the language is amazing. Personally I use fiber but because I have chosen to work with it thanks to the "Express inspired" tag, and it works for me and I learned how to use it, so I will keep using it.
To be fair, I stopped caring about frameworks and their "wars". Until they are well maintained, easy to use and follow the "standard" pattern (so I don't spend more time to learn it, rather implement it from zero) I'm down to any of them... Oh, almost forgot! Have a proper jwt handling system! The only thing that matters for me, if I don't have to touch the ready code in the following few months for the fault of the framework.
so i think a beginner for me, just use standard library. if i'm applying to jobs, just follow what framework do they use. is my way thinking right?
Same
I am looking to migrate from NestJS. There main feature I am looking for is having a way to expose types and generate Open API. What is the closest to the standard library I can use?
This was helpful thanks. I'm just starting to learn go and trying to get the lay of the land. One of the questions i had was, do I even need a framework?
Hi So I tried Chi v5 and Fiber v3 to build somewhat similar create user application just to test it out. Complexity wise it was more or less same, no major issue. The only difference I felt was in response time. For me chi was able to give the response back in close to half the time fiber was taking. I am not sure if that is always the case coz I have just recently start go so I might have skipped out on few things. Anyways out of chi and fiber which one in general would be a better choice?
I use Go Fiber since it reminded me of FastAPI/Express and I get so much hate for it on Reddit like I kicked a puppy since it uses the fasthttp router. I promised myself that as soon HTTP3 with UDP becomes a thing I'll convert away from Fiber which is easy since all frameworks are roughly the same implementation. Is using Fiber really that big of a cosmic sin?
Nope. Choose the right tool for the job. Good performance? An API that makes you productive? Sall good.
Chose it for a project in work involving migrating Python microservices to Go. It worked out great.
I've used Gin and the standard library. I ALSO used Revel! Don't use Revel! It uses a separate build tool!
Gin is great!
That's why I love python ecosystem so much when it comes to web frameworks. All inclusive? Django. Rest API with some freedom? FastAPI. Total freedom? Flask.
All these have their use cases and serve a purpose. In go I feel that everything is almost the same and there are no clear benefits to using one tool over the other. I guess given some time they will "split" at some point.
I don't use Go that often, just for small side projects here and there, and I rarely see a need for bringing in a third party dependency for most things. The only thing I wish was in the std lib http router is support for url parameters like `/users/:id`. If it had that, it would be amazing, although it is very good already
Maybe try gin-gonic next time. It is not much more than the std stuff but it has routing with URI parameters and a lot of other features.
Fiber does this
fiber can do this easily
Haven't tried yet, but that should be out now in Go 1.22. Previously I've used gorilla/mux for some basic routing with variables, otherwise just plain bog standard http.HandlerFunc.
It has that. Since 1.22
Hey Melky, perfect timing. Do you know how to deploy a golang backend that uses go fiber on vercel serverless? I can't find any example online
Is it possible, though? Thought Vercel was for Node only
@@HenriqueNewsted vercel does have a runtime for GO but the docs don't help much, i tried yesterday just copying the hello world example they have and not even that worked...
@@vicentebravocabezas yeah I think the .mod and .sum files have to be at the root of the project and the main.go file gotta be inside the api folder (talking about a nextjs project)
I’m enjoying go ent framework. Have you taken a look at it?
The only thing I find lacking in the std lib is variables in the url string, but that's a feature that's coming soon
I don't know about the go frameworks but this is the best go channel.
You're the best thank you
Can you make a series on building different apps with just the standard library?
Yeah
Yep, made a server just using the standard library. Granted I had some LLM hints but overall it ended not looking and being that much more complicated than Gin… like all you need is a switch statement for the rest methods for routing, etc
I DID follow the path you recommended. I went the purist standard library path. Then my projects grew more complex and I ended up trying to write MY OWN PRIVATE framework just for this project, re-inventing the wheels of Chi, Echo, Gin and Fiber! I was so proud NOT to import modules and frameworks.
Today I know that THAT was a waste of time! My project took 6 months to let's say ... take shape. With a framework I would have done it in 6 weeks!
So my advice today is: If you want to get things done, DO use a framework, and then DO study the source code of your framework to understand how it works and why it works the way it does. The debugger is your best friend here.
I like go's extensive standard library but I still believe frameworks is making developers life easier. They abstract things and help you to move faster. when you are writing your own saas application (depending on domain) most of the time you are not interested whats going on under the hood you are interested how fast I can move my mvp and do marketting etc
the new 1.22 routing is really gonna help use straight library for this...
YEP!
I have a video about this coming out soon!!
Hey bro I think you are not read the documentation of fasthttp. It isnt written over net/http golang it has its own worker pull and written over tcp.
I tend to use huma along with echo. And then when I really need performance I just use fiber. But fiber is very rarely required.
I will consider go if you use different photo for the thumbnails.
Go is meant to be simple, straightforward and productive. Many people that comes from other languages struggles with this difference and start looking for frameworks and libraries for everything. This language is very easy to adopt and will turn you into an expert programmer very quickly.
It can certainly turn you into a Go expert very quickly
Tried all of those and also iris. I always come back to gin. There's smth really neat about that library
What about .NET and C#?
wow thanks. I was literally in the situation of going from javascript searching THE framework
Dont do it!!
I really like axum
I’d rather trust go team than 3rd party libs developers in security matters.
No one develops from scratch as we’ve already got rich net/http.
This sets go apart from other languages: you don’t need so many external dependencies to build web apps. For example, beloved Rust: it has absolutely nothing out of the box, and to make even the simplest web app you need to add a list of crates, and be familiar with their apis that don’t follow any common rules and vary greatly from one to another.
@MelkeyDev What about BeeGo?
real chads write their own framework
Check out go-blueprint
These were great points, but GoChi sounds like a DragonBall character so it's obviously better.
Quick, get Shenron and revive dead frameworks
Ever since the standard library added support for path variables and http verbs, this advice is when more relevant!
i LOOOOOVE the httprouter, using this in production at massive scales and it‘s just awesome. This is literally what the go default router should actually be!
i like fiber, because it have sane default '__'), have adapter to use net/http also, best performance because bufferpool
oh but too bad the default logger is bottleneck, that's why i use other stuff to log (clickhouse directly if structured, or onelog/zerolog/zap)
GOATED video
I learned go TO NOT LEARN just another framework.
no more frameworks please
I’m the 5 th person to comment here
And I guess using standard go is annoying for me bc I came from php and js backend 😂😂
If you came to go to do the same stuff you did on js and php kinda defeats the point of choosing go doesn't it? Just think why you chose go 😅
Go doesn't need frameworks. Never did. You pick nice modules that fits into your requirements, so your application becomes "a framework". And that is exactly what makes everything great.
Yes sir!
thanks for pointing this up .. i will use gin I see how it goes
Awesome - let me know!
Holy shit I did so much PHP is this video real or not
I thought that this video was click bait but was not, thanks for that
Hey Melkey. Might be out of context for this particular video, but can do a video showcasing how and when you use queues, tools like rabbitmq in Golang (programming in general)? 🥹
Bro i have one of those headphones and hands down is one of the best and most unique sounding ones, awesome for female vocals as well
Surpriesed gorilla/mux isn't here. Especially since it's being maintained again.
There just too many! It's definitely a good one
Wait what??? I thought gorilla/mux was abandoned since December 2022
Thanks bro, this was good learning for me. Although my current needs simply don't require anything other than Python and maybe a bit of SQL/HTML, maybe one day I might need a better tool.
Using a standard lib sounds fun until you have 300 endpoints. I settled on fiber. For any thing less than 50 routes. I use stdlib
Great point!
you just add a not so well known or maintained library to the list which contrast you point. :)
Which one..?
not everyone has to do everything from scratch. there are useful middleware provided with the frameworks. its better to learn everything from scratch if you are a beginner but not everyone has the time to implement already existing middleware and other utility functions provided by third party libraries
Yup+!
As someone migrating to Go, the biggest problem I see in community is not over-engineering, but under-engineering.
A lot of Go developers try to build everything from scratch, which increses the lead time of projects, specially if you work with microservices.
And every new thing you need, you need to build by yourself. What's wrong with using libraries and frameworks? Answer: nothing, it's about choosing your fights. How many security breachs are we deploying just for the sake of "use the std lib".
Under-engineering is a problem just as big as over-engineering.
But sure, let's be purists, what could go wrong? zzzzzz
Btw, I love Go, I just didn't learn yet to like the Go purists community.
I've used goa a lot at work, but I would always stick to the standard library for a hobby project
How about for non-hobby projects?
it's funny how the definition of a framework differs from PHP to any other language
in PHP you have a lot of boiler plate already preset that cover logic you find in at least 80% of cases and you don't want to waste time setting them up, BASSICALLY USING THE "REUSE" WORD TO THE MAX
in other languages you pretty much just have a small wrapper over the basic language, i think most of the time you will waste writing documentation for what does what in each directory
great video! go is robust and solid by yourself!
Yes! Thank you!
there is something real about frameworks
If you pay close attention to them and how they work,
you forget to become a real programmer in your language,
for the loss of time that this requires.
It is better to learn the language well and make your own environment.
Oh no, I wanted to learn vulpix for a second T.T
I'll go with fiber given that i'd be more likely to encounter it more often haha
Given Go 1.22, time to update this video. 🤔
I, believe you are right sir
Go is the framework.
Yep!
Thank you for this very useful video!
Godamn son
Cool video
Really good information and a yugioh fan? Thumbs up for sure
Omegachads just use the standard lib bruh.
Im about done with the basic version of my first web server with some authentication. Im sure once i turn it into a big project, ill eat the crow.
Bro you have issue with angular
no i do not
@@MelkeyDev just guessing since you didn't mention angular but all libraries and frameworks
All my homies use standard library
all my homies
amazing video, go feels nice, small
:) thank you
@@MelkeyDev after looking at hundreds of javascript framework this seems so clean and minimal
I use oapi-codegen in strict mode as my framework.
In this case, I'm creating my own. Let's go to the JS culture in GO hahaha
too bad I'm not very good at using the standard library
To put it short: use Chi or accept the c developer ways of making it yourself
Ok I will use gorilla/mux
this is the TLDR right here folks
A bit superficial analysis. Obviously if you just look at the core basic functionality, they all look the same. But if you dive a bit deeper you will start noticing clear and important differences among those tools
Okay! Can you share some examples?
"The JavaScript problem" LMAO
I use chi. I secretly think videos like this are slight unhelpful bc someone coming from python,java, js really should be given an answer... strengths of each...and then you should explain why it doesn't matter and how thin they are and why go is different.... I say this because I don't think the std lib message lands until they've dived into programming go, usually using chi or something...Just my opinion - great vid!
Edit: and i only say this bc i just lived this lol
Yes, you are right
Flow router by Alex Edwards. It's tiny, simple, and great.
All of them are just routers with some middleware functionality and some of them use "framework" keyword just because of newcomers coming from JavaScript :)
GO TIME
Gorilla Mux ?? Std>Gorilla>= Chi >others
Thank goodness it's the TRUTH.
I only speak the TRUTH
there is a unskipable fucking ad on this clip which goes like 30 minutes. How the f should people watch this?
really?
this is the first time im hearing this - i didnt even know it was there
Snorlax is the best Go framework 💪🏻
Chi + std library ❤