# quii/learn-go-with-tests

**Attribution required: if you use, quote, or summarise this content, you must credit and link back to [awesome-repositories.com](https://awesome-repositories.com/repository/quii-learn-go-with-tests).**

23,510 stars · 2,935 forks · Go · mit

## Links

- GitHub: https://github.com/quii/learn-go-with-tests
- awesome-repositories: https://awesome-repositories.com/repository/quii-learn-go-with-tests.md

## Topics

`go` `golang` `tdd` `test-driven-development` `testing`

## Description

This project is an educational platform and tutorial series designed to teach the Go programming language through the practice of test-driven development. It provides a structured path for developers to master language fundamentals, concurrency, and standard library usage by building functional applications in small, verifiable increments.

The core methodology centers on the test-driven development cycle, where failing tests are written before implementation to define requirements and ensure code correctness. This approach is applied across a wide range of practical scenarios, including the construction of networked applications, HTTP servers, and command-line utilities. By emphasizing interface-based design and dependency injection, the project demonstrates how to decouple business logic from external systems, making codebases more modular and easier to test.

The curriculum covers a broad capability surface, ranging from basic data structures and collection management to advanced topics like concurrent process synchronization, memory optimization, and real-time communication via WebSockets. It also explores software design patterns such as table-driven testing, mock-based isolation, and graceful resource management, ensuring that learners gain experience with both language mechanics and professional development workflows.

The repository is organized as a comprehensive guide where documentation examples are validated through automated test execution, ensuring that all instructional content remains accurate and functional.

## Tags

### Education & Learning Resources

- [Go Programming Tutorials](https://awesome-repositories.com/f/education-learning-resources/educational-resources/reference-and-media/tutorials-media-curated-lists/technical-tutorials/programming-languages/go-programming-tutorials.md) — Provides a structured, test-driven curriculum for mastering Go language fundamentals, concurrency, and standard library usage through practical application building.
- [Language Fundamentals](https://awesome-repositories.com/f/education-learning-resources/educational-resources/languages-and-programming-concepts/software-engineering-languages/language-fundamentals.md) — Provides structured exercises and examples to master core language grammar and mechanics. ([source](https://quii.gitbook.io/learn-go-with-tests))
- [Encapsulation Techniques](https://awesome-repositories.com/f/education-learning-resources/educational-resources/languages-and-programming-concepts/programming-language-mastery-guides/object-oriented-programming-concepts/encapsulation-techniques.md) — Encapsulates internal state by restricting field access and exposing changes through methods. ([source](https://quii.gitbook.io/learn-go-with-tests/go-fundamentals/pointers-and-errors))
- [Code Examples](https://awesome-repositories.com/f/education-learning-resources/educational-resources/reference-and-media/books-docs-reference/code-examples.md) — Validates documentation examples by compiling and executing code snippets during the test suite run. ([source](https://quii.gitbook.io/learn-go-with-tests/go-fundamentals/integers))

### Testing & Quality Assurance

- [Software Testing](https://awesome-repositories.com/f/testing-quality-assurance/software-testing.md) — Teaches test-driven development as the primary methodology for building robust, verified software. ([source](https://quii.gitbook.io/learn-go-with-tests/gb-readme.md))
- [Test-Driven Development Resources](https://awesome-repositories.com/f/testing-quality-assurance/software-testing/test-driven-development-resources.md) — Teaches software design principles by requiring developers to write failing tests before implementing functional code across various application scenarios.
- [Unit Testing](https://awesome-repositories.com/f/testing-quality-assurance/software-testing/testing-frameworks/unit/unit-testing.md) — Core focus on executing automated unit tests to verify individual code logic and ensure correctness. ([source](https://quii.gitbook.io/learn-go-with-tests/go-fundamentals/hello-world))
- [Testing Best Practices](https://awesome-repositories.com/f/testing-quality-assurance/testing-best-practices-methodologies/testing-best-practices.md) — Teaches robust software development by writing failing tests before implementation to define requirements.
- [Dependency Mocking](https://awesome-repositories.com/f/testing-quality-assurance/software-testing/dependency-mocking.md) — Replaces external system dependencies with lightweight, in-memory doubles to verify behavior without triggering side effects or network requirements.
- [Test Fixture Systems](https://awesome-repositories.com/f/testing-quality-assurance/software-testing/testing-frameworks/test-frameworks/execution-and-infrastructure/test-infrastructure-configuration/test-fixture-systems.md) — Demonstrates dependency injection via interfaces to enable swapping components for test-friendly buffers. ([source](https://quii.gitbook.io/learn-go-with-tests/go-fundamentals/mocking))
- [Test Patterns](https://awesome-repositories.com/f/testing-quality-assurance/software-testing/testing-strategy-process/test-patterns.md) — Organizes multiple test scenarios into a single data structure to validate logic across various inputs without duplicating test boilerplate code.
- [Failure Verification Tools](https://awesome-repositories.com/f/testing-quality-assurance/general-testing-utilities/test-failure-debugging-tools/failure-verification-tools.md) — Ensures tests are capable of failing by observing failure before writing implementation code. ([source](https://quii.gitbook.io/learn-go-with-tests/meta/anti-patterns))
- [Test Isolation](https://awesome-repositories.com/f/testing-quality-assurance/general-testing-utilities/test-isolation.md) — Ensures test isolation by replacing external systems with controlled doubles to avoid network requirements. ([source](https://quii.gitbook.io/learn-go-with-tests/testing-fundamentals/working-without-mocks))
- [Error Type Assertions](https://awesome-repositories.com/f/testing-quality-assurance/general-testing-utilities/test-utilities-assertions/error-type-assertions.md) — Verifies expected error conditions by performing type assertions during automated tests. ([source](https://quii.gitbook.io/learn-go-with-tests/questions-and-answers/error-types))
- [End-to-End Testing](https://awesome-repositories.com/f/testing-quality-assurance/software-testing/e2e-integration-testing/end-to-end-testing.md) — Implements high-level acceptance tests to verify system requirements from a user-centric perspective. ([source](https://quii.gitbook.io/learn-go-with-tests/go-fundamentals/math))
- [Behavior-Driven Testing](https://awesome-repositories.com/f/testing-quality-assurance/testing-best-practices-methodologies/quality-assurance-practices/testing-methodologies/behavior-driven-testing.md) — Validates software functionality from a business-oriented perspective to ensure user requirements are met. ([source](https://quii.gitbook.io/learn-go-with-tests/testing-fundamentals/scaling-acceptance-tests))
- [Test Utilities & Assertions](https://awesome-repositories.com/f/testing-quality-assurance/general-testing-utilities/test-utilities-assertions.md) — Provides utilities for writing focused, readable test assertions that avoid coupling to internal implementation details. ([source](https://quii.gitbook.io/learn-go-with-tests/meta/anti-patterns))
- [Assertion Message Customizers](https://awesome-repositories.com/f/testing-quality-assurance/general-testing-utilities/test-utilities-assertions/assertion-extensions-modes/assertion-message-customizers.md) — Attaches descriptive messages to assertions to provide clear feedback when tests fail. ([source](https://quii.gitbook.io/learn-go-with-tests/meta/anti-patterns))
- [Pointer Receivers](https://awesome-repositories.com/f/testing-quality-assurance/general-testing-utilities/test-utilities-assertions/browser-ui-interaction/component-interaction-testing/pointer-interaction-tools/memory-pointers/pointer-receivers.md) — Updates original struct values using pointer receivers to avoid unnecessary data copying. ([source](https://quii.gitbook.io/learn-go-with-tests/go-fundamentals/pointers-and-errors))
- [HTTP Interaction Recorders](https://awesome-repositories.com/f/testing-quality-assurance/general-testing-utilities/test-utilities-assertions/network-api-mocking/http-interaction-recorders.md) — Captures and replays network responses to facilitate consistent testing without requiring live network calls. ([source](https://quii.gitbook.io/learn-go-with-tests/build-an-application/http-server))
- [Performance Measurement](https://awesome-repositories.com/f/testing-quality-assurance/performance-testing-analysis/performance-diagnostics/performance-measurement.md) — Provides tools and techniques to measure code performance and identify bottlenecks through repeated execution. ([source](https://quii.gitbook.io/learn-go-with-tests/go-fundamentals/iteration))

### Development Tools & Productivity

- [Data-Driven Testing](https://awesome-repositories.com/f/development-tools-productivity/data-driven-testing.md) — Teaches the use of table-driven tests to validate multiple scenarios efficiently within a single test structure. ([source](https://quii.gitbook.io/learn-go-with-tests/go-fundamentals/roman-numerals))
- [Command Line Applications](https://awesome-repositories.com/f/development-tools-productivity/command-line-interfaces/command-line-applications.md) — Provides structured guidance on building command-line utilities and processing terminal input. ([source](https://quii.gitbook.io/learn-go-with-tests/build-an-application/app-intro))
- [Project Lockfile Management](https://awesome-repositories.com/f/development-tools-productivity/dependency-managers/installation-resolution-utilities/project-lockfile-management.md) — Uses configuration files to manage dependencies and ensure reproducible builds across environments. ([source](https://quii.gitbook.io/learn-go-with-tests/go-fundamentals/hello-world))
- [Background Task Schedulers](https://awesome-repositories.com/f/development-tools-productivity/background-task-schedulers.md) — Executes a function after a specified duration in a separate background process to handle time-based events. ([source](https://quii.gitbook.io/learn-go-with-tests/build-an-application/time))
- [Code Organization](https://awesome-repositories.com/f/development-tools-productivity/code-organization.md) — Organizes code into packages to separate domain logic from executable entry points. ([source](https://quii.gitbook.io/learn-go-with-tests/build-an-application/command-line))
- [Contract Validators](https://awesome-repositories.com/f/development-tools-productivity/debugging-profiling-testing/test-execution-management/test-suites/contract-validators.md) — Ensures test doubles adhere to defined interface behaviors to maintain consistency across the test suite. ([source](https://quii.gitbook.io/learn-go-with-tests/testing-fundamentals/working-without-mocks))
- [File System Operations](https://awesome-repositories.com/f/development-tools-productivity/file-system-operations.md) — Interacts with the operating system to manage file I/O and execute external commands. ([source](https://quii.gitbook.io/learn-go-with-tests/llms.txt))
- [Performance Benchmarking](https://awesome-repositories.com/f/development-tools-productivity/performance-benchmarking.md) — Measures code execution speed under controlled conditions to quantify optimization impact. ([source](https://quii.gitbook.io/learn-go-with-tests/go-fundamentals/concurrency))

### Networking & Communication

- [HTTP Servers](https://awesome-repositories.com/f/networking-communication/http-clients/http-servers.md) — Listens for incoming network requests and generates appropriate responses to facilitate communication between remote clients and application logic. ([source](https://quii.gitbook.io/learn-go-with-tests/build-an-application/app-intro))
- [WebSocket Servers](https://awesome-repositories.com/f/networking-communication/distributed-systems-p2p/distributed-computing/communication-protocols/websocket-implementations/websocket-servers.md) — Opens full-duplex communication channels between a browser and a server to enable real-time, asynchronous data updates. ([source](https://quii.gitbook.io/learn-go-with-tests/build-an-application/websockets))
- [WebSocket Implementations](https://awesome-repositories.com/f/networking-communication/websocket-implementations.md) — Creates persistent connections between the server and clients to enable the immediate exchange of data in both directions. ([source](https://quii.gitbook.io/learn-go-with-tests/build-an-application/app-intro))
- [Local HTTP Servers](https://awesome-repositories.com/f/networking-communication/local-http-servers.md) — Implements lightweight web servers for simulating external service responses during local test execution. ([source](https://quii.gitbook.io/learn-go-with-tests/go-fundamentals/select))
- [Networked Application Frameworks](https://awesome-repositories.com/f/networking-communication/networked-application-frameworks.md) — Constructs servers and persistent communication channels to handle client requests, manage routing, and process data streams in real-time environments. ([source](https://quii.gitbook.io/learn-go-with-tests/llms.txt))

### Programming Languages & Runtimes

- [Safe Concurrency Primitives](https://awesome-repositories.com/f/programming-languages-runtimes/language-features-paradigms/concurrency-models/safe-concurrency-primitives.md) — Manages parallel execution and shared state safely using synchronization primitives and communication channels.
- [Type Methods](https://awesome-repositories.com/f/programming-languages-runtimes/type-methods.md) — Implements methods on custom types to encapsulate behavior and improve code organization. ([source](https://quii.gitbook.io/learn-go-with-tests/go-fundamentals/structs-methods-and-interfaces))
- [Mutual Exclusion Locks](https://awesome-repositories.com/f/programming-languages-runtimes/language-features-paradigms/concurrency-models/concurrency/synchronization-primitives/mutual-exclusion-locks.md) — Uses mutual exclusion locks to manage shared-state concurrency and prevent race conditions. ([source](https://quii.gitbook.io/learn-go-with-tests/go-fundamentals/sync))
- [Generic Function Definitions](https://awesome-repositories.com/f/programming-languages-runtimes/programming-utilities/functional/generic-function-definitions.md) — Defines generic functions that maintain compile-time type safety across multiple data types. ([source](https://quii.gitbook.io/learn-go-with-tests/go-fundamentals/generics))
- [Stream Processing Interfaces](https://awesome-repositories.com/f/programming-languages-runtimes/stream-processing-interfaces.md) — Uses standard reader and writer interfaces to process data from files or memory buffers. ([source](https://quii.gitbook.io/learn-go-with-tests/build-an-application/io))

### Software Engineering & Architecture

- [Concurrency Synchronization Primitives](https://awesome-repositories.com/f/software-engineering-architecture/concurrency-synchronization-primitives.md) — Coordinates concurrent execution using synchronization primitives and channels to prevent race conditions. ([source](https://quii.gitbook.io/learn-go-with-tests/llms.txt))
- [Dependency Injection](https://awesome-repositories.com/f/software-engineering-architecture/integration-extensibility/dependency-injection.md) — Emphasizes dependency injection to decouple business logic from external systems and improve testability. ([source](https://quii.gitbook.io/learn-go-with-tests/llms.txt))
- [Generic Data Abstractions](https://awesome-repositories.com/f/software-engineering-architecture/abstract-data-types/generic-data-abstractions.md) — Uses interfaces and generics to define flexible, reusable, and type-safe data structures. ([source](https://quii.gitbook.io/learn-go-with-tests/llms.txt))
- [Headless Logic Decoupling](https://awesome-repositories.com/f/software-engineering-architecture/headless-logic-decoupling.md) — Demonstrates architectural patterns for decoupling core business logic from HTTP transport and request handling. ([source](https://quii.gitbook.io/learn-go-with-tests/questions-and-answers/http-handlers-revisited))
- [Logic Decoupling](https://awesome-repositories.com/f/software-engineering-architecture/software-architecture/architectural-patterns/modular-decoupled-design/structural-design-paradigms/decoupled-logic-encapsulation/logic-decoupling.md) — Decouples business logic from side effects to enable testable and modular code. ([source](https://quii.gitbook.io/learn-go-with-tests/go-fundamentals/hello-world))
- [Domain Type Definitions](https://awesome-repositories.com/f/software-engineering-architecture/data-structures/domain-type-definitions.md) — Groups related data fields into named types to improve code clarity and domain modeling. ([source](https://quii.gitbook.io/learn-go-with-tests/go-fundamentals/structs-methods-and-interfaces))
- [File System Abstractions](https://awesome-repositories.com/f/software-engineering-architecture/file-system-abstractions.md) — Uses interfaces to decouple application logic from specific file system storage implementations. ([source](https://quii.gitbook.io/learn-go-with-tests/go-fundamentals/reading-files))
- [Stream Abstractions](https://awesome-repositories.com/f/software-engineering-architecture/stream-abstractions.md) — Uses standard reader and writer interfaces to decouple application logic from specific storage implementations like files or network buffers.
- [Concurrent Task Runners](https://awesome-repositories.com/f/software-engineering-architecture/concurrent-task-runners.md) — Executes multiple function calls in separate processes simultaneously to prevent blocking and reduce the total time required for sequential operations. ([source](https://quii.gitbook.io/learn-go-with-tests/go-fundamentals/concurrency))
- [Package-Based Code Organization](https://awesome-repositories.com/f/software-engineering-architecture/package-based-code-organization.md) — Separates domain logic from executable entry points to allow multiple binaries to share the same underlying codebase and library functions.
- [RPC Cancellation](https://awesome-repositories.com/f/software-engineering-architecture/rpc-cancellation.md) — Uses cancellation signals to terminate background tasks and prevent resource leaks. ([source](https://quii.gitbook.io/learn-go-with-tests/go-fundamentals/context))
- [Surgical Code Refactoring](https://awesome-repositories.com/f/software-engineering-architecture/surgical-code-refactoring.md) — Supports precise, verified code modifications to ensure structural improvements do not alter existing behavior. ([source](https://quii.gitbook.io/learn-go-with-tests/meta/anti-patterns))
- [Custom Error Definitions](https://awesome-repositories.com/f/software-engineering-architecture/custom-error-definitions.md) — Encapsulates error conditions within custom types to enable programmatic inspection and better error handling. ([source](https://quii.gitbook.io/learn-go-with-tests/questions-and-answers/error-types))

### Web Development

- [HTTP Servers](https://awesome-repositories.com/f/web-development/http-servers.md) — Constructs modular web servers and APIs by routing requests and decoupling business logic from transport concerns.
- [HTTP Request Handling](https://awesome-repositories.com/f/web-development/backend-development/request-response-handling/http-request-handling.md) — Processes incoming network requests by implementing a handler interface that interprets data and writes responses back to the client. ([source](https://quii.gitbook.io/learn-go-with-tests/build-an-application/http-server))
- [HTTP Handler Interfaces](https://awesome-repositories.com/f/web-development/http-handler-interfaces.md) — Processes network requests by implementing standard handler interfaces that interpret incoming data and write responses back to the client.
- [Handler Test Utilities](https://awesome-repositories.com/f/web-development/http-request-handlers/handler-test-utilities.md) — Invokes handler functions directly with mock objects to verify status codes and response bodies. ([source](https://quii.gitbook.io/learn-go-with-tests/questions-and-answers/http-handlers-revisited))
- [Request Routing](https://awesome-repositories.com/f/web-development/request-routing.md) — Directs incoming web requests to specific handler functions by matching URL paths to logic using a request multiplexer. ([source](https://quii.gitbook.io/learn-go-with-tests/build-an-application/json))

### User Interface & Experience

- [Refactoring Workflows](https://awesome-repositories.com/f/user-interface-experience/ui-architecture/design-utilities/design-systems/design-system-documentation-strategy/design-systems-and-style-guides/refactoring-workflows.md) — Guides developers in updating system architecture and method signatures through iterative, test-driven refactoring. ([source](https://quii.gitbook.io/learn-go-with-tests/testing-fundamentals/refactoring-checklist))
- [HTML Template Renderers](https://awesome-repositories.com/f/user-interface-experience/layout-utilities/presentation-engines/template-engines/server-side-rendering-engines/html-template-renderers.md) — Generates dynamic web pages by processing structured templates to return formatted content instead of plain text or raw data. ([source](https://quii.gitbook.io/learn-go-with-tests/build-an-application/websockets))

### DevOps & Infrastructure

- [In-Memory Fakes](https://awesome-repositories.com/f/devops-infrastructure/infrastructure-state-management-systems/in-memory-fakes.md) — Uses lightweight, in-memory fakes to manage state and simulate dependencies during test execution. ([source](https://quii.gitbook.io/learn-go-with-tests/testing-fundamentals/working-without-mocks))
- [Time-Based Triggers](https://awesome-repositories.com/f/devops-infrastructure/automation-orchestration/task-execution-frameworks/event-based-triggers/time-based-triggers.md) — Executes operations at specific intervals or delays to manage background processes and time-sensitive logic within an application. ([source](https://quii.gitbook.io/learn-go-with-tests/build-an-application/app-intro))
- [Graceful Shutdowns](https://awesome-repositories.com/f/devops-infrastructure/graceful-shutdowns.md) — Implements graceful server shutdown logic to ensure active connections complete before process termination. ([source](https://quii.gitbook.io/learn-go-with-tests/testing-fundamentals/intro-to-acceptance-tests))
- [Multi-Binary Projects](https://awesome-repositories.com/f/devops-infrastructure/cicd-pipeline-automation/core-build-engines/build-infrastructure/build-execution/multi-binary-projects.md) — Supports generating multiple distinct binary applications from a single shared source repository. ([source](https://quii.gitbook.io/learn-go-with-tests/build-an-application/command-line))

### Data & Databases

- [External Data Connectors](https://awesome-repositories.com/f/data-databases/external-data-connectors.md) — Uses interface-based dependency injection to decouple business logic from external data access mechanisms. ([source](https://quii.gitbook.io/learn-go-with-tests/questions-and-answers/os-exec))
- [Application Persistence](https://awesome-repositories.com/f/data-databases/persistent-storage-management/application-persistence.md) — Reads and writes information to disk storage and arranges records into specific sequences to support application data management requirements. ([source](https://quii.gitbook.io/learn-go-with-tests/build-an-application/app-intro))
- [Resource Teardown](https://awesome-repositories.com/f/data-databases/resource-management/resource-teardown.md) — Schedules teardown logic at the end of function scopes to release resources. ([source](https://quii.gitbook.io/learn-go-with-tests/go-fundamentals/select))
- [Flat-File Data Stores](https://awesome-repositories.com/f/data-databases/data-engineering-infrastructure/data-persistence-storage/data-storage-architectures/flat-file-data-stores.md) — Persists application state to JSON files to ensure data availability across restarts. ([source](https://quii.gitbook.io/learn-go-with-tests/build-an-application/io))
- [Key-Value Stores](https://awesome-repositories.com/f/data-databases/key-value-stores.md) — Associates values with unique keys to enable efficient data retrieval. ([source](https://quii.gitbook.io/learn-go-with-tests/go-fundamentals/maps))
- [Runtime Introspection](https://awesome-repositories.com/f/data-databases/type-inspection-tools/runtime-introspection.md) — Examines variable structures at runtime to perform operations on types unknown during compilation. ([source](https://quii.gitbook.io/learn-go-with-tests/go-fundamentals/reflection))

### Operating Systems & Systems Programming

- [Allocation Strategies](https://awesome-repositories.com/f/operating-systems-systems-programming/kernel-core-internals/process-and-memory-management/memory-management/allocation-strategies.md) — Minimizes memory overhead by using specialized buffers to reduce allocations. ([source](https://quii.gitbook.io/learn-go-with-tests/go-fundamentals/iteration))
