This guide explains how to set up a development environment for Retro AIM Server and build/run the application. It assumes that you have little to no experience with golang.
Before you can run Retro AIM Server, set up the following software dependencies.
Since Retro AIM Server is written in go, install the latest version of golang.
If you’re new to go, try Visual Studio Code wth the go plugin as your first IDE.
Mockery is used to generate test mocks. Install this dependency and regenerate the mocks if you change any interfaces.
go install github.com/vektra/mockery/v2@latest
Run the following command in a terminal from the root of the repository in order to regenerate test mocks,
mockery
To run the server using go run
, run the following script from the root of the repository. The default settings can be
modified in config/settings.env
.
scripts/run_dev.sh
To build the server binary:
go build -o retro_aim_server ./cmd/server
To run the binary with the settings file:
./retro_aim_server -config config/settings.env
Retro AIM Server includes a test suite that must pass before merging new code. To run the unit tests, run the following command from the root of the repository in a terminal:
go test -race ./...
The config file config/settings.env
is generated programmatically from the Config struct using
go generate
. If you want to add or remove application configuration options, first edit the Config struct and then
generate the configuration files by running make config
from the project root. Do not edit the config files by hand.