
We previously didn't really had any structure in our project apart from creating a new folder for each package in our project root. Now that we have accumulated some packages, we use the well-known Golang project layout in order to clearly communicate our intent with packages. See https://github.com/golang-standards/project-layout
13 lines
271 B
Go
13 lines
271 B
Go
package api
|
|
|
|
import (
|
|
"net/http"
|
|
)
|
|
|
|
// Health handles the health route.
|
|
// It responds that the server is alive.
|
|
// If it is not, the response won't reach the client.
|
|
func Health(writer http.ResponseWriter, _ *http.Request) {
|
|
writer.WriteHeader(http.StatusNoContent)
|
|
}
|