This project is intended to illustrate good engineering practices for golang applications. See GoEngineering for more information.
Build, Run, Test
The service can be built and run in one command from the project directory
> go run cmd/petserver
This starts a server listening on port 4852. The port can be configured using the
-p <port> flag.
> go run cmd/petserver -p 9412
Install petserver on your local machine using
> go install cmd/petserver
> petserver <args>
To run unit tests, use the command
> go test ./...
The same command can be used to generate a code coverage report using some options
> go test -coverprofile=coverage.out ./... && go tool cover -html=coverage.out
This will create a file
coverage.out that contains information about code coverage (in unreadable form)
The second command opens a browser and displays coverage information.