Member-only story

Beautify your Golang project

Shaon Shaonty
ITNEXT
Published in
4 min readJul 31, 2018

organize your golang project as well as your code

In my last article, I have created a service which was unorganized and only for beginner. My motive was to provide a basic concept of creating REST service and go forward step by step.

If you are not familiar with my previous post you can go through the link below for understanding functionality. It’s not hard to check a glance or if you have previous knowledge about building web API service then you can be processed.

In this tutorial, I am going to show how to organize a project. Organize your code is important because when you want to change some logic of your previous code then the well structured project can easily adopt the changes and as well as save times. Although there are contradictory opinion about project structuring and I prefer the structure of 4 layers. You can replace or modify anything from here.

project/
model/
repository/
handler/
driver/
main.go

models

Published in ITNEXT

ITNEXT is a platform for IT developers & software engineers to share knowledge, connect, collaborate, learn and experience next-gen technologies.

Written by Shaon Shaonty

Data Scientist | Software Engineer | Computer Science Graduate @TU Dresden

Responses (18)

Write a response