How bregman-arie/go-exercises works
Project type and purpose
• This is a learning-and-practice repository for the Go programming language. It’s organized as a monolithic Git repository containing:
• A collection of exercises (markdown + Go code) grouped by topic under /exercises/
• A sample “Simple Web Server” project under /projects/simple_web_server/
• Static assets (images) under /images/
• Utility scripts (e.g., count_questions.sh) and a Makefile for automation
File structure
• Top-level directories:
• /exercises/ – each subdirectory is a self-contained exercise: Markdown description (exercise.md), optional solution (solution.md or main.go), and go.mod if needed
• /projects/simple_web_server/ – a standalone Go HTTP server serving static HTML/CSS from /static/
• /images/ – Go Gopher illustrations used in README
• /scripts/ – small shell scripts for repo maintenance
• Root files: Makefile invokes scripts or runs tests; README.md is the central index of exercises and questions
README for additional insights
• The README enumerates all exercises, questions, and the sample project, linking to their files.
• It describes the purpose (“learn and practice Golang”) and technology stack (Go language, Markdown, shell scripts).
a. Main components
1. Developer / Learner (actor)
2. Git Repository (versioned content)
3. Exercise Module
– Markdown renderer (e.g., GitHub Pages or local Markdown viewer)
– Go runner/compiler for solutions
4. Sample Web Server Project
– HTTP Server (Go’s net/http)
– Static File Handler (/static/*.html)
5. Asset Store (/images/)
6. Automation Layer (Makefile + Shell scripts)
b. Relationships and interactions
• The Developer clones the Git repo → views README.md → picks an exercise → opens exercise.md in a Markdown viewer → writes/compiles Go code (main.go) with go run
• The Makefile orchestrates calls to scripts/count_questions.sh or other maintenance tasks
• The Sample Web Server component is built (go build) and run (./simple_web_server), listening on a port → serves HTML pages from /static/
• Static assets (Gopher images) are referenced by the README and exercises
c. Architectural patterns/design principles
• Monolithic content repository (no microservices)
• Clear separation of concerns by directory: exercises vs. projects vs. assets vs. scripts
• Convention-over-configuration: each exercise follows the same file-naming pattern
• Use of standard Go tooling (go mod, go run, net/http)
d. Relevant technologies/frameworks/libraries
• Go language toolchain (go mod, go build, go run, net/http)
• Markdown for exercise descriptions
• Shell (bash) scripts for repo metrics
• Makefile for high-level tasks
Essential architectural elements to capture
• Entry point (README as index)
• Module boundaries (exercises vs. projects vs. scripts)
• Tooling interactions (Makefile → scripts, Go toolchain)
• Runtime flow for the Simple Web Server
[Developer] → clones → [Git Repo:
• README index → lists → Exercise Modules (Md + Go)
• Project Module: Simple Web Server (HTTP Server + Static File Handler + /static/ assets)
• Asset Module: /images/
• Automation Module: Makefile ↔ scripts
]