Skip to content

David-Orson/go-mastery

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

📘 GoLang Exercises Directory

Welcome to the GoLang Exercises Directory! This repository is designed to provide a structured learning path covering all fundamental and advanced topics in Go. Each topic is accompanied by a dedicated exercise file with self-contained challenges to help reinforce your understanding of Go.

🚀 How to Use This Repository

Each directory contains a main.go file with exercise prompts written as comments. Your task is to complete them without looking at references to strengthen your memory and problem-solving skills.

🔧 Setup Instructions

  1. Clone this repository:
    git clone https://github.com/your-repo/golang-exercises.git
    cd golang-exercises
  2. Run any exercise:
    go run XX_topic/main.go

    Note: Replace XX_topic with the actual folder name (e.g., 01_hello_world).

  3. Use the provided run.sh script to compile-check all exercises.

📂 Directory Structure

Fundamentals

  1. 01_hello_world - Print your first message in Go
  2. 02_variables - Working with variables and types
  3. 03_strings - Manipulating strings and formatting
  4. 04_numbers - Arithmetic, floating points, and precision
  5. 05_arrays_slices - Working with arrays and slices
  6. 06_maps - Key-value storage using maps
  7. 07_structs - Defining and using structs
  8. 08_control_flow - If statements, loops, and switches
  9. 09_functions - Function definitions, return values, and recursion
  10. 10_interfaces - Polymorphism and dynamic types

Intermediate Topics

  1. 11_errors - Handling errors and creating custom errors
  2. 12_enums - Simulating enums in Go
  3. 13_concurrency - Goroutines, channels, and synchronization
  4. 14_file_io - Reading/writing files efficiently
  5. 15_http_server - Building a basic HTTP server
  6. 16_pointers - Memory management with pointers
  7. 17_json_handling - Parsing and generating JSON
  8. 18_cli - Command-line applications and argument parsing
  9. 19_regex - Pattern matching with regular expressions
  10. 20_testing - Writing unit tests and benchmarks

Advanced Concepts

  1. 21_reflection - Dynamic type inspection and modification
  2. 22_generics - Using generics for flexible code
  3. 23_context - Managing timeouts and cancellations
  4. 24_middleware - HTTP middleware for logging, authentication, etc.
  5. 25_grpc - Implementing gRPC services and clients
  6. 26_dependency_injection - Using DI for clean architecture
  7. 27_dbs - Connecting to databases and executing queries
  8. 28_bits - Bitwise operations and optimizations
  9. 29_time_date - Working with time, date, and timezones

Performance & Optimization

  1. 30_string_performance - Efficient string manipulation
  2. 31_file_strings - Handling large text files efficiently
  3. 32_multilingual_strings - Processing Unicode and multilingual text
  4. 33_string_encoding - Base64, hex, and URL encoding/decoding

📜 Contribution Guidelines

We welcome contributions to expand this repository! Here’s how you can help:

  • Fix typos, improve comments in exercises
  • Add new topics that are useful for Go developers
  • Suggest improvements for existing exercises

🔹 To contribute:

  1. Fork the repository
  2. Create a new branch:
    git checkout -b feature/topic-improvement
  3. Commit changes and push:
    git commit -m "Improved exercises for concurrency"
    git push origin feature/topic-improvement
  4. Open a Pull Request with a clear description of your changes.

🎯 Goals of This Repository

✔️ Reinforce core Go concepts with hands-on practice
✔️ Cover advanced topics that improve performance & scalability
✔️ Provide self-contained exercises for easy learning
✔️ Maintain idiomatic Go best practices

Happy Coding! 🎉

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published