Go by Example: Programmer's Guide to Idiomatic and Testable Code
暫譯: Go 語言範例:程序員的慣用法與可測試代碼指南

Gumus, Inanc

  • 出版商: Manning
  • 出版日期: 2025-09-30
  • 售價: $1,750
  • 貴賓價: 9.5$1,663
  • 語言: 英文
  • 頁數: 336
  • 裝訂: Quality Paper - also called trade paper
  • ISBN: 1617299898
  • ISBN-13: 9781617299896
  • 相關分類: Go 程式語言
  • 尚未上市,無法訂購

商品描述

Go beyond Go syntax into the language's unique perspective on program design.

Through engaging hands-on examples, Go by Example will teach you to think differently about programming in Go. You'll get to grips with the "Go mindset", writing code that's simple, straightforward, and easy to understand for your fellow Go developers. You'll discover how Go's tooling helps you write code that's robust and testable, and see just how productive you can be with Go's rich set of built-in packages.

In Go by Example you will learn how to:

- Understand what makes Go different and adopt its philosophy for simple, pragmatic, and straightforward code
- Write idiomatic code that's robust, efficient, maintainable, and inherently testable by design
- Identify common Go mistakes and apply proven patterns for higher quality code
- Structure and organize effective Go packages and APIs
- Build performant concurrent programs with Go's unique concurrency

Go by Example explores what makes Go so dramatically different from other languages. Through hands-on and realistic project examples--like command-line tools, web services, and scalable concurrent programs--it helps experienced developers unlearn habits and quickly become productive in crafting truly Go-like, high-quality code.

About the technology

You can't appreciate the simplicity, explicitness, and pragmatism of Go until you see it with your own eyes! Even a quick glance at an elegant interface or a bit of clean error handling code reveals why Go was the language of choice for Kubernetes, Docker, and Terraform.

About the book

Go by Example unpacks real Go programs to highlight the language features and idiomatic coding practices used by the pros. In it, you'll dissect and explore examples of command-line tools, concurrent programs, web services, and more as you learn to write Go code that's simple, efficient, and testable.

What's inside

- Acquire the "Go mindset"
- Write idiomatic, reliable, and maintainable code
- Structure Go projects and packages
- Best practices and antipatterns

About the reader

For experienced programmers.

About the author

Inanc Gumus is a veteran programmer who has specialized in Go since 2012. Inanc has educated over 100,000 developers through his social presence, GitHub repositories, online courses, and his popular blog.

Table of Contents

1 Getting started
2 Idioms and testing
3 Test coverage and optimization
4 Command-line interfaces
5 Dependency injection
6 Synchronous APIs for concurrency
7 Responsive and efficient programs
8 Structuring packages and services
9 Composition patterns
10 Polymorphic storage

Get a free eBook (PDF or ePub) from Manning as well as access to the online liveBook format (and its AI assistant that will answer your questions in any language) when you purchase the print book.

商品描述(中文翻譯)

超越 Go 語法,深入了解該語言在程式設計上的獨特視角。

透過引人入勝的實作範例,Go by Example 將教你以不同的方式思考 Go 程式設計。你將掌握「Go 心態」,撰寫簡單、直接且易於理解的程式碼,讓其他 Go 開發者也能輕鬆閱讀。你會發現 Go 的工具如何幫助你撰寫穩健且可測試的程式碼,並看到使用 Go 的豐富內建套件後,你的生產力能達到多高。

Go by Example 中,你將學會如何:

- 理解 Go 的獨特之處,並採納其簡單、務實且直接的程式碼哲學
- 撰寫符合慣用法的程式碼,這些程式碼在設計上是穩健、高效、可維護且本質上可測試的
- 辨識常見的 Go 錯誤,並應用經過驗證的模式以提高程式碼品質
- 結構化和組織有效的 Go 套件和 API
- 使用 Go 獨特的併發特性構建高效的併發程式

Go by Example 探索了 Go 與其他語言之間的顯著差異。透過實作和真實的專案範例——如命令列工具、網路服務和可擴展的併發程式——它幫助有經驗的開發者打破舊習慣,迅速在撰寫真正符合 Go 風格的高品質程式碼上變得高效。

關於技術

你無法真正體會 Go 的簡單性、明確性和務實性,直到你親眼見到它!即使是快速瀏覽一個優雅的介面或一段乾淨的錯誤處理程式碼,也能揭示為何 Go 成為 Kubernetes、Docker 和 Terraform 的首選語言。

關於本書

Go by Example 拆解真實的 Go 程式,以突顯專業人士使用的語言特性和慣用編碼實踐。在書中,你將剖析和探索命令列工具、併發程式、網路服務等範例,學習撰寫簡單、高效且可測試的 Go 程式碼。

內容概覽

- 獲得「Go 心態」
- 撰寫符合慣用法、可靠且可維護的程式碼
- 結構化 Go 專案和套件
- 最佳實踐和反模式

關於讀者

適合有經驗的程式設計師。

關於作者

Inanc Gumus 是一位資深程式設計師,自 2012 年以來專注於 Go。Inanc 通過他的社交媒體、GitHub 倉庫、線上課程和受歡迎的部落格,教育了超過 100,000 名開發者。

目錄

1 開始入門
2 慣用法與測試
3 測試覆蓋率與優化
4 命令列介面
5 依賴注入
6 併發的同步 API
7 響應式與高效能程式
8 套件與服務的結構化
9 組合模式
10 多型儲存

購買印刷版書籍時,您將獲得 Manning 提供的免費電子書(PDF 或 ePub),以及訪問線上 liveBook 格式(及其 AI 助手,能用任何語言回答您的問題)的權限。