A simple two-player Chinese Checkers game playable in the terminal, written in Go.
- Standard Go project structure (
cmd/
,internal/
). Makefile
for automating common development tasks (build, test, lint, run).Dockerfile
for a consistent Go development environment with necessary tools (includingstaticcheck
).- Linting configured with
staticcheck
. - Basic
HelloWorld
example function with a corresponding unit test. - Development workflow entirely containerized via Docker.
- Ready for further development of the Chinese Checkers game logic!
Before you begin, ensure you have the following installed:
- Docker: To build and run the development container. Install Docker
- Make: To use the Makefile automation. (Usually pre-installed on Linux/macOS, may need installation on Windows).
(Note: Go and staticcheck do NOT need to be installed locally.)
Clone the repository, then:
-
Install the development Docker Image: This creates the container image with the Go environment and tools. Run this once initially, or when the
Dockerfile
changes.make install
-
Run the CLI: This runs the project inside the container.
# Show help. APP_ARGS="--help" make run # Run with arguments. APP_ARGS="--state-file tests/states/ongoing-game.json --move c1,d1" make run
-
Test: Runs all Go tests inside the container.
make test
-
Using Make Commands: With the container running, use standard
make
commands directly from your terminal. They automatically execute inside the Docker container:make build Build the Go binary (inside Docker). make check Run `staticcheck` and `go vet` (inside Docker). make clean Remove the built binary (inside Docker). make deps Tidy `go.mod` and `go.sum` files (inside Docker). make docker-exec Run a command inside the docker container - Example: make docker-exec CMD="ls -l" make install Build the Docker development image. make lint Run `staticcheck` linter (inside Docker). make run run the application. make test Run Go tests (inside Docker). make vet Run `go vet` (inside Docker).
(See Makefile Targets below or run
make help
for all commands) -
Accessing the Container Shell (Optional): If you need direct shell access inside the container:
docker exec -it chinese-checkers-dev-instance bash # Now you are inside the container at /app # You can run Go commands (go test...) or make commands directly here. # Type 'exit' to leave the container shell
cmd/chinese-checkers/ # Main entry point
internal/game/ # Core game logic
bin/ # Binary file