Golang Rest API项目结构

I just started learning/using Golang, and want to develop a restful API (starting with this great video tutorial).

Do we have a best practice for the project structure for Golang projects? (such as dropwizard's suggested project structure for java)

for example should I put the model (API request/response) in a separate directory? what is the suggested naming for API calls (equivalent to resources in dropwizard)? etc.

any suggestions/reference is appreciated

A good structure for web applications I use is the following:

└───app
    ├───config
    ├───controllers
    └───models

I think its pretty straightforward to understand

For rest-api i use something like below,

.
├───app
│   ├───handlers
│   |───models
|   └───app.go
|───config
└───main.go

Where,

  1. main.go - just pulls the config and bootstraps the api,
  2. config - contains the configurations,
  3. handlers - contains all the route handlers,
  4. models - contains models to carry the data,
  5. app.go - assembles the route with handlers