An interactive CLI application for learning Go programming concepts through hands-on practice. This project provides a structured learning experience with explanations, examples, and coding challenges.
- Interactive Learning: Step through Go concepts with guided explanations
- Hands-on Practice: Solve real coding problems in your editor
- AI-Powered Explanations: Optional AI-generated comprehensive explanations using Google Gemini
- Progressive Difficulty: 16 lessons covering fundamentals to advanced topics
- Immediate Feedback: Built-in testing for your solutions
- Variables and Types
- Slices and Arrays
- Functions and Methods
- Structs and Interfaces
- Pointers and Memory Management
- Packages and Modules
- Control Flow (if/else, loops, switch)
- Data Structures (maps, custom types)
- Error Handling
- Concurrency (goroutines, channels)
- Generics
- Context and Cancellation
- Structured Logging
- JSON Processing
- Testing and Benchmarking
- Go 1.25+ installed and available on your PATH
- Text Editor (VS Code, GoLand, Vim, etc.)
# Clone the repository git clone https://github.com/yourusername/go-learn.git cd go-learn # Run the application go run ./cmdEnhance your learning experience with AI-powered explanations:
- Get a Google Gemini API key from Google AI Studio
- Set the environment variable:
export GEMINI_API_KEY="your-api-key-here"
- Restart the application
Features:
- Comprehensive explanations with practical examples
- Real-time content generation
- Automatic fallback to static explanations if AI is unavailable
- Beginner-friendly content tailored for Go learners
- Choose a Topic: Select from 16 available lessons
- Learn: Read explanations and study examples
- Practice: Solve coding challenges in your editor
- Test: Run automated tests to verify your solutions
- Repeat: Continue with the next topic
--- π Go Learning Environment π --- Choose a topic to learn, or type 'q' to quit: 1. Variables and Types 2. Slices ... > 1 --- Topic: Variables and Types --- 1. Explain π§ 2. Show Example β¨ 3. Solve Problem π» b. Back to main menu > 1 --- AI-Generated Explanation --- [Comprehensive explanation with examples and best practices] go-learn/ βββ cmd/ β βββ main.go # CLI entry point βββ internal/ β βββ lessons/ β β βββ lessons.go # Lesson registry and runner β β βββ 1_variables_lesson.go β β βββ 2_slices_lesson.go β β βββ ... # Individual lesson files β βββ problems/ β βββ 1_variables.go β βββ 2_slices.go β βββ ... # Practice problem files βββ go.mod βββ go.sum βββ README.md βββ CONTRIBUTING.md βββ LICENSE See CONTRIBUTING.md for detailed instructions on adding new lessons.
# Build only the CLI (recommended) go build -o go-learn ./cmd # Build the entire workspace go build ./...# Test the entire project go test ./... # Test specific packages go test ./internal/lessonsGo makes it easy to cross-compile for different operating systems and architectures. Here are the commands to build binaries for Windows, Linux, and macOS:
For convenience, we've included build scripts for different platforms:
# Make the script executable and run it chmod +x build.sh ./build.sh# Run the PowerShell script .\build.ps1 # Or with options .\build.ps1 -Release # Also create release archives .\build.ps1 -Clean # Clean before buildingIf you prefer using make commands on Windows, you can install GNU Make via winget:
# Install GNU Make winget install ezwinports.make # Restart your terminal/command prompt to refresh PATH # Then use make commands normally: make help # Show available targets make windows # Build Windows binary make linux # Build Linux binary make release # Build all platforms + create archivesAfter running any build script, you'll find the binaries in the bin/ directory:
bin/ βββ go-learn-windows-amd64.exe # Windows 64-bit βββ go-learn-windows-386.exe # Windows 32-bit βββ go-learn-linux-amd64 # Linux 64-bit βββ go-learn-linux-386 # Linux 32-bit βββ go-learn-linux-arm64 # Linux ARM64 βββ go-learn-darwin-amd64 # macOS Intel βββ go-learn-darwin-arm64 # macOS Apple Silicon | Method | Platforms | Use Case | Speed |
|---|---|---|---|
go run ./cmd | Current platform only | Development | Fastest |
go build ./cmd | Current platform only | Local deployment | Fast |
GOOS=... go build | Single target platform | Specific deployment | Medium |
./build.sh | All platforms | Distribution | Slower |
make release | All platforms + archives | Official releases | Slowest |
We welcome contributions! Please see our Contributing Guide for details on:
- Adding new lessons
- Improving existing content
- Reporting bugs
- Feature requests
- Code style guidelines
This project is licensed under the MIT License - see the LICENSE file for details.
- Built with β€οΈ for the Go community
- Inspired by interactive learning platforms
- Powered by Google Gemini for AI explanations
- Add testing and proper coverage
- Additional Go lessons eventually
- Update Gemini to pull docs link for fully accurate data
- Make problems solvable in the cli
- π€· Who knows what else, may not even make it to these items this was a random idea that turned out pretty fun
Happy Learning! π
Found this helpful? β Star the repo and share with fellow Go developers!