- Hello World - Basic program structure
- Data Types - Types, variables, and constants
- Control Structures - Flow control and branching
- Collections - Arrays, slices, and maps
- Functions - Function declarations and usage
- Types and Pointers - Memory management
- Structs and Interfaces - Custom types and abstraction
- Generics and Embedding - Generic programming and composition
- Error Handling - Error types and handling
- Concurrency - Goroutines and basic concurrency
- Advanced Channels - Channel patterns and usage
- Worker Pools - Concurrent worker patterns
- Sync Primitives - Mutexes and synchronization
- Sorting - Sorting algorithms and interfaces
- Panic, Defer, Recover - Error flow control
- Strings and Templates - String manipulation
- JSON and XML - Data serialization
- Time Handling - Time operations
- Parsing and Random - Text parsing and randomization
- Hashes and Encoding - Cryptography basics
- File Operations - File system handling
- File Utilities - Advanced file operations
- Testing and Benchmarking - Advanced testing
- CLI - Command-line interfaces
- Environment and Logging - Configuration and logs
- HTTP Client and Server - HTTP client/server
- Context and Processes - Process management
- Signals and Exit - Signal handling
- Go 1.21 or higher (some examples use newer features)
- Basic understanding of Go programming concepts
- Text editor or IDE
- Terminal/Command Prompt
Each example directory contains:
- Source code files (
.go
) - README with explanations and instructions
- Tests where applicable
- Any necessary resource files
To run an example:
cd <example-directory>
go run main.go
- Fork the repository
- Create a feature branch (
git checkout -b feature/amazing-example
) - Commit your changes (
git commit -m 'Add a new example'
) - Push to the branch (
git push origin feature/amazing-example
) - Create a Pull Request
Each example follows these principles:
- Clear and documented code
- Proper error handling
- Unit tests where applicable
- Consistent formatting (using
go fmt
) - Idiomatic Go patterns
- Performance considerations
- Security best practices
This project is licensed under the MIT License - see the LICENSE file for details.