This codebase was created to demonstrate a backend application built with Golang including CRUD operations, routing, pagination, and more.
┌── api
│ └── swagger.yml // API Spec
├── cmd
│ └── server
│ └── main.go // Server Start
├── internal // Project internal files
│ └── app
│ ├── api.go // Business Logic & Router
│ └── api_test.go // Business Logic Tests
└── Dockerfile // Dockerfile for building an image
Make sure you have Go 1.17 or higher installed.
https://golang.org/doc/install
Set-up the standard Go environment variables according to latest guidance (see https://golang.org/doc/install#install).
From the project root, run:
go build ./...
go test ./...
go mod tidy
From the project root, run:
go test ./...
or
go test ./... -cover
or
go test -v ./... -cover
depending on whether you want to see test coverage and how verbose the output you want.
go run ./...