The documentation for this package is hosted through pkg.go.dev, and can be found here
The main entry point into the program is main.go
in the root directory. You can either build an executable called
main
using go build main.go
or run it directly using go run main.go
. With both methods, there are currently
two subcommands that can be used:
-
./main run [--port=9000]
: This runs the entire backend server. The-p
or--port
flag can be added to specify the port of the server -
./main run <name>
: This creates a new api with the specified name. It modifies all necessary files and creates new skeleton code inside theapi/<name>
folder.
When testing a specific package, inside the package's directory, use
go test -coverprofile /tmp/cp.out
to run tests and show test coverage. To view the coverage in a browser, use
go tool cover -html=/tmp/cp.out
to visualize what parts of the code are not being tested.
To test all files, run
go test ./...
from the root directory to test everything inside the repo.