STOP! This Is How You Structure Golang Applications

  Рет қаралды 21,999

Anthony GG

Anthony GG

Күн бұрын

Пікірлер: 52
@anthonygg_
@anthonygg_ Жыл бұрын
► Join my Discord community for free education 👉 discord.com/invite/bDy8t4b3Rz ► Become a Patreon for exclusive tutorials 👉 www.patreon.com/anthonygg_ Thanks for watching
@EricFialkowski
@EricFialkowski Жыл бұрын
Too many developers forget that the goal is solving the problem, not playing around with all the "computer science-y" stuff. Don't get me wrong, that stuff is what got me into programming but it doesn't pay the mortgage or buy the margaritas. 🍹👍
@tehseensajjad1003
@tehseensajjad1003 Жыл бұрын
i dont remember who said it or where or how it was said but "Whats ultimately important is the value your program is going to provide to the user, not the tools you're building it with"
@su1cedek
@su1cedek Жыл бұрын
Thanks, very simple and straightforward. I think the "cmd" folder is only useful if your project has multiple executables, i.e. if you have multiple CLI tools, or a rest+grpc APIs
@pelic9608
@pelic9608 Жыл бұрын
Stopped using 'cmd' folder after company's cybersec approached me the third time for running unkmown .exe with 'cmd' in the path. 😄
@vitiok78
@vitiok78 Жыл бұрын
If you want to write a huge monolith then by all means use Clean Architecture, good abstractions, and all that stuff. But... Go is the best when it comes to microservices. And you don't need to add that kind of complexity to a microservice. You'll only burn all your time. Microservices don't usually live long and you will eventually kill them or rewrite completely. So... Do not overengineer things. Make it simple, make it fast, make it readable.
@AlbertBalbastreMorte
@AlbertBalbastreMorte 8 ай бұрын
YES! The crazy structures needed for code that's 1M lines long are usually overkill for microservices!
@vitiok78
@vitiok78 Жыл бұрын
I often put every API handler in its own file because it's an entry point and you often need some extra helper functions logically tied to this entry point only. But all the middleware that is common to multiple entry points I put in a single file. It is very convenient to find and change them later.
@ElderSnake90
@ElderSnake90 Жыл бұрын
Finally a sane developer!
@ryanjoy0000
@ryanjoy0000 Жыл бұрын
Awesome ! Proud to be part of HVE family!
@JackWeaver
@JackWeaver Жыл бұрын
Imagine building a house. 450 sqft, it's like a studio apartment. You don't need massive support beams, or reinforced foundation, etc. This would be like a minimal approach, no crazy deep nested folders, etc. Just solving the problem and done. Now imagine building a sky-scraper. You're going to need a hell of a lot more. This would be your gigantic enterprise application, with multiple go modules, folders & organization, documentation, etc etc. But you have to be aware of the scope of the problem, and fit that problem with the appropriate sized tactics.
@aqezzz
@aqezzz 7 ай бұрын
Definitely agree. Lots of developers today see (and especially start with) small software problems to solve and forget that big software comes with its own set of problems that *do* have to be solved. No one made these patterns up for fun, they did it to get out of the hell that is a huge spaghetti code base that developers literally quit over. No, you don't need all the architectural patterns for hello world, but yes they do have a place when software grows to a certain size.
@CorleyPC
@CorleyPC Жыл бұрын
Good stuff! All projects should be born with a flat structure. If the need for restructuring arises, refactoring is cheap. Bearing with useless folders isn't.
@mm100latests5
@mm100latests5 Жыл бұрын
great edu vids, i've learned golang completely from scratch using your channel and patreon
@kavereon
@kavereon Жыл бұрын
You're really knowledgeable and hilarious! 😂 I'm glad I found your channel. Subscribed!
@toroktechnology7420
@toroktechnology7420 Жыл бұрын
Don't get me wrong but this has many downsides - refactoring - scaling - solving deep business problems - this will not work for team has different members because updating and writing everything in the root file will result my merge conflicts
@anthonygg_
@anthonygg_ Жыл бұрын
Im the deviation. I decide
@austecon6818
@austecon6818 Жыл бұрын
Most software projects only have 2-3 developers anyway... many have a one dev per microservice policy. Any project that grows beyond 2-3 devs would already have scaled up to having most things separated out into directories a long time ago...
@WaldirBorbaJunior
@WaldirBorbaJunior Жыл бұрын
Perfect. Just as I work. 1st make it work and let the customer happy and put money into my pocket. 2nd. refactor the code. Simple as that. #go4ever
@EricWAtchesVideos
@EricWAtchesVideos 6 ай бұрын
Will you please do a video on go-echarts? Specifically how to group and filter axes in bar or line charts.
@thesaintseiya
@thesaintseiya 7 ай бұрын
Great video, really helps me as someone new to Go! I however put my main package in a cmd/app folder simply because I don't want it laying around the 20 JavaScript/frontend config files lmao. Also love your style of humor
@idearat0
@idearat0 2 ай бұрын
"You are not programming... you are confused. You are not a programmer... you are a configurator." -- Anthony GG ... priceless.
@EnterCloud
@EnterCloud Жыл бұрын
The title definitely caught my attention
@vitiok78
@vitiok78 Жыл бұрын
1. Just make it work. 2. Throw it away. 3. Write it better the second time using the info from step 1. 4. Margaritas!!!
@90hijacked
@90hijacked Жыл бұрын
Don't diss my attention span senpai! I've been watching these videos every day after work for a couple months now! -- sincerely, a lurker
@austecon6818
@austecon6818 Жыл бұрын
100%. That's partly why I like python so much... when I moved to C# I was lost for words at the insane over-engineering!!! Python let's you scale up the project structure as it is called for. I'm sure you can do the same I'm C# but it's not what the culture encourages
@Nexjsdeveloper
@Nexjsdeveloper Жыл бұрын
This video is so usefull for me, also if u can, make a video for creating video streaming server by pure golang and not with help of "HLS" like your video for large stream files.
@DUKENNSCHMILPs
@DUKENNSCHMILPs Жыл бұрын
With too many folders/packages also you can get the problem of cyclic depedencies.
@anthonygg_
@anthonygg_ Жыл бұрын
So true
@suikast420
@suikast420 7 ай бұрын
What about if you build a lib. At least the internal is very useful. Isn't it?
@aslkdjfzxcv9779
@aslkdjfzxcv9779 Жыл бұрын
second time the in the last couple days i've heard of "hexagonal" architecture. figured it's just DI.
@deNudge
@deNudge Жыл бұрын
Not exactly. It's more like onionskins. Inside you have the business logic, outside you have everything for I/O.
@aslkdjfzxcv9779
@aslkdjfzxcv9779 Жыл бұрын
@@deNudge thanks, i'll have to dig a little deeper
@Nexjsdeveloper
@Nexjsdeveloper Жыл бұрын
You r the best " honestly i don't know what is it"" 🤣🤣🤣🤣🤣
@dr3w979
@dr3w979 Жыл бұрын
Thanks for this
@tgaming2518
@tgaming2518 Жыл бұрын
Amazing videos! Thank you so much
@adanpalma4026
@adanpalma4026 12 күн бұрын
Any time that you spend designing a more manteinable software and don’t respeat your self is priceless. Is not overthhink is arxhitecture. Any can write Lines of code and solve problems but build more manteinable software umm no sure
@guledomer
@guledomer Жыл бұрын
wonderful. Just do it, it doesnt matter
@hassananwar2431
@hassananwar2431 Жыл бұрын
I think I was forgeting main problem and was lost in my folder structuring...
@anthonygg_
@anthonygg_ Жыл бұрын
You are cured now.
@Flascoo
@Flascoo Жыл бұрын
support comment for youtube algos sheeesh
@GrahamAtDesk
@GrahamAtDesk Жыл бұрын
Very pragmatic 👍
@cipcip4986
@cipcip4986 Жыл бұрын
another beer 🍻
@goocarry_dailyroutine
@goocarry_dailyroutine Жыл бұрын
👍🏻👍🏻👍🏻
@nodidog
@nodidog Жыл бұрын
Your comment about ports being equal to skill level 😂
@anthonygg_
@anthonygg_ Жыл бұрын
No more 1337 or 3000 from now on.
@charlesbcraig
@charlesbcraig Жыл бұрын
“You are not a programmer. You are confused” 😂
@bodunjo
@bodunjo Жыл бұрын
I start this shit on stream))
@TheSupahG
@TheSupahG Жыл бұрын
sheeesh, so many mouse clicks, probably the most from all your videos
@anthonygg_
@anthonygg_ Жыл бұрын
Lmao true that.
@su1cedek
@su1cedek Жыл бұрын
I feel pain every time he writes ACcount
Introduction To The Actor Paradigm In Golang
20:29
Anthony GG
Рет қаралды 12 М.
How To Use The Context Package In Golang?
17:03
Anthony GG
Рет қаралды 61 М.
The Joker wanted to stand at the front, but unexpectedly was beaten up by Officer Rabbit
00:12
小丑妹妹插队被妈妈教训!#小丑#路飞#家庭#搞笑
00:12
家庭搞笑日记
Рет қаралды 36 МЛН
The BEST Tool to Structure Golang Projects
7:58
Melkey
Рет қаралды 31 М.
The Most Efficient Struct Configuration Pattern For Golang
11:10
How To Structure Your Golang (API) Projects!?
20:28
Anthony GG
Рет қаралды 47 М.
This Will Make Everyone Understand Golang Interfaces
21:03
Anthony GG
Рет қаралды 51 М.
Important Tips On How To Write Idiomatic Code In Golang
21:52
Anthony GG
Рет қаралды 22 М.
How To Use Goroutines For Aggregating Data In Golang?!
17:15
Anthony GG
Рет қаралды 40 М.
Beginners Should Think Differently When Writing Golang
11:35
Anthony GG
Рет қаралды 109 М.
2 Years Of Learning C | Prime Reacts
22:24
ThePrimeTime
Рет қаралды 287 М.
This Is The BEST Way To Structure Your GO Projects
11:08
Melkey
Рет қаралды 75 М.
The Joker wanted to stand at the front, but unexpectedly was beaten up by Officer Rabbit
00:12