Documentation › Traditional web application › Admin Makefile
Every codebase includes a Makefile in the project root. This contains a variety of commands to make it easy to run common administration and development tasks.
The following commands are available:
| Command | Description |
|---|---|
help |
Print a list of available commands with their descriptions. |
audit |
Run all tests, verify modules, check .go file formatting, and run go vet, staticcheck, and govulncheck. This command reports problems but does not make any changes to your codebase. |
test |
Run all tests, with race detection and VCS stamping enabled. |
test/cover |
Run all tests with coverage, save results to /tmp/coverage.out, and display an HTML report. |
upgradeable |
List direct module dependencies that have upgrades available and optionally update them. |
tidy |
Run go mod tidy -v, apply go fix, and format all Go files with go fmt. |
build |
Build the cmd/web application and output the binary to /tmp/bin/web. |
run |
Build and run the cmd/web application. |
run/live |
Build and run the cmd/web application with live reloading, rebuilding on file changes. See the live reloading documentation for more information. |
To use these commands you will need the Make tool installed on your computer. It's typically preinstalled on macOS and most Linux distributions.
You can run the Makefile commands from your terminal by typing make followed by the command name. For example:
$ make help $ make audit $ make run/live
Feel free to edit the contents of the Makefile. It's totally OK to add new commands or change the existing ones to suit your needs
Note: Depending on the options you select when generating a codebase, the Makefile may also include additional commands for managing SQL migrations. Please see the managing SQL migrations documentation for more information.