Learn Go syntax and idioms if you already know another programming language.
Build disciplined testing habits while learning a new language through practical exercises.
Study how to structure a real application with HTTP endpoints, JSON handling, and WebSocket support.
Practice test-driven development workflow with guided, incremental coding challenges.
Learn Go with Tests is a free online book and code repository that teaches the Go programming language through test-driven development, often abbreviated TDD. TDD is a programming practice where you write a failing test first, then write just enough code to make it pass, then clean up your code, repeating this cycle to build software incrementally. The material starts with Go fundamentals, variables, loops, functions, data structures, and teaches each concept by writing a test for it first and then implementing it. This approach serves two goals simultaneously: learning Go syntax and learning disciplined testing habits. The content progresses from basic exercises to building a full application (an HTTP server with JSON responses, file persistence, and WebSockets). Each chapter is short and focused on one topic, building on the previous. The book also covers testing-specific topics like mocking, working without mocks, acceptance tests, and common anti-patterns to avoid. You would use this resource if you already have some programming experience and want to learn Go properly, with good habits built in from the start. It is particularly useful for developers moving from another language who want to pick up idiomatic Go alongside a disciplined testing workflow. The content is available for free as a website, and as EPUB or PDF downloads. It has been translated into multiple languages including Chinese, Japanese, Portuguese, Korean, and French. All examples are written in Go.
Generated 2026-05-18 · Model: sonnet-4-6 · Verify against the repo before relying on details.