A
A
Anton Mashletov2018-04-05 14:22:26
go
Anton Mashletov, 2018-04-05 14:22:26

How to properly organize the file structure of a Go web project?

For learning purposes, I decided to step a little further than helloworld and write a simple chat.
Here I have created a chat folder in the (gopath)/src directory. And I don't know what to do next. Where to store the backend on go. Where to store the frontend (source)? Do I need to share with .go-files somehow? Maybe it's worth creating 2 subfolders backend and frontend in the chat folder and point GOPATH to the backend?
PHP frameworks more or less rigidly set such folders (controllers, views, resouces, public, ...), right there - it's not clear.

Answer the question

In order to leave comments, you need to log in

2 answer(s)
P
Pavel Shvedov, 2018-04-05
@mashletov

take some golang web framework, it is desirable that it also be able to generate the structure of application files, see how they organize it, and if you don’t want to use the framework itself, then at least you can lick the structure, but just do tutorials on this topic on the Internet, for example here

V
Viktor Chistyakov, 2018-04-06
@vityachis

I think that it is worth looking at not one, but a couple of frameworks, how they work, how everything is organized. And for example, in one framework, there may be something convenient, but something, on the contrary, interfere and annoy. Therefore, you need to look at a couple of solutions, understand why it was done that way and choose the best from each. After all, a lot of mind is not needed to just lick everything :)

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question