This Is The BEST Way To Structure Your GO Projects

This Is The BEST Way To Structure Your GO Projects

Melkey

10 месяцев назад

63,379 Просмотров

Ссылки и html тэги не поддерживаются


Комментарии:

Melkey
Melkey - 03.08.2023 18:54

GO CONTENT IS AWESOME!
I HOPE YOU ALL ENJOY IT.
MAKE SURE TO COMMENT AND SUBSCRIBE- it really means the world <3

Ответить
Ayla Croft
Ayla Croft - 10.11.2023 04:24

😅 I need to learn Go. I think Backend dev is adding Go to their courses.

Ответить
Omar Crosby
Omar Crosby - 04.11.2023 17:18

Can you explain why you prefer to keep tests in a separate folder instead of next to the files they are intended to test? Just curious.

Ответить
Fresh2Death
Fresh2Death - 31.10.2023 22:49

Ackshually, on Linux theyr'e called directories not folders

Ответить
VikingTheDude
VikingTheDude - 24.10.2023 07:37

What if we create a cmd/main.go instead of nesting it within another folder?

Ответить
VikingTheDude
VikingTheDude - 24.10.2023 07:34

Do we gitignore the bin directory? Considering that the contains the output build, we wouldn’t wanna track that in version control right?

Ответить
Gilmar Palega
Gilmar Palega - 20.10.2023 02:08

I charge like 50% extra amount when I have to work on a project with this structure.

Ответить
Adeadura Adegbite
Adeadura Adegbite - 09.10.2023 10:47

whoa 10k subs already, way to go

Ответить
Christopher Aulotte
Christopher Aulotte - 07.10.2023 12:15

Amazing content !

Maybe it's a useless question but is it better to use Gin or Go the hard way to build a full Rest API ?

Ответить
CyberLanka
CyberLanka - 03.10.2023 15:22

Hey what about the embed package? I don't think it's possible to embed static files outside of cmd directory or handlers.

Ответить
Light
Light - 03.10.2023 04:26

The biggest annoyance for me has been maintaining go versions and updates. Theres no inbuilt go update latest. you have to know the latest version number and manually manage that, then manually manage env vars which is also gross, I shouldn't have to be touching that imo.

Ответить
flalspspsl
flalspspsl - 02.10.2023 19:04

how do i use code from inside my INTERNAL folder in another folder in INTERNAL folder.. like i have some funcs that do some basic shit and i wanna use them to make it easier instead of writing their implementations out every time

Ответить
Ad Ici De
Ad Ici De - 02.10.2023 18:40

i work in go but the second I see "go is awesome" I'm out :D

Ответить
Andres Court
Andres Court - 24.09.2023 05:14

Wait what, do you actually test??? Lol

Ok in a serious note, you should make a video on go testing

Ответить
Arie Ardiansyah
Arie Ardiansyah - 21.09.2023 07:08

When I create go project. I always follow MVC like PHP framework folders.
- routes -> routes.go
- models -> post.go
- databases -> database.go
- controllers -> post_controllers.go, etc
- views ->
- layouts -> layout.html
- pages -> home.html, about,html, etc
- middlewares -> auth.go
main.go
go.mod

I dont know its good or bad. But it make easier for me to trace something and so familiar with other projects with different languages.

Ответить
Ahmet Adem
Ahmet Adem - 18.09.2023 21:59

wow, happy see some nice educative golang content. i would love yo see some real world api project with best practices. Just like you would do for some clinet

Ответить
RandomShowerThoughts
RandomShowerThoughts - 18.09.2023 03:26

Personally I don’t like having a test directory, the tests should be near the source code with a _test name

Ответить
pavel astraukh
pavel astraukh - 16.09.2023 09:26

Thank you so much. For last few years I was programming in ruby using rails framework where layout is defined by framework and I was really struggling with figuring out what layout to use.

Ответить
Azizul maqsud
Azizul maqsud - 15.09.2023 20:42

nice,,, but, plz proceed with more hands on.... then it would be better for the audience. Ty

Ответить
Kris Lui
Kris Lui - 15.09.2023 07:11

just started on go recently and struggling with structuring my project. watched a couple videos on that but seems like opinions are quite contradicting. anyway, great walkthrough, helps a lot

Ответить