MVC Strucutre is being followed.
main.go
: Driver Code for all of backend.
models
: Database Models
controllers
: Various handlers for HTTP Requests
routes
: Definitions of Sub-routers
utils
: Middlewares and other files common to multiple functions
scripts
: Extra scripts (unrelated to the usual flow of the webapp)
docs
: Documentation
-
Separate file for each Model.
-
Controller functions to be grouped together by their routes.
-
Each Subroute has a separate file.
In short, don't keep any surprises. Use groupings as per your discretion.
gorilla/mux
jinzhu/gorm
dgrijalva/jwt-go
Also uses golanglint-ci
for linting code.
-
Clone the repo.
-
Run
go get
to install the dependencies -
Run
go run main.go
in the terminal -
Run
go build
to build into a single binary. -
Run
gofmt -s -w .
to lint all the files in one go.