Effective Go Recipes: Fast Solutions to Common Tasks
暫譯: 有效的 Go 食譜:常見任務的快速解決方案

Tebeka, Miki

  • 出版商: Pragmatic Bookshelf
  • 出版日期: 2024-05-14
  • 售價: $2,120
  • 貴賓價: 9.5$2,014
  • 語言: 英文
  • 頁數: 278
  • 裝訂: Quality Paper - also called trade paper
  • ISBN: 1680508466
  • ISBN-13: 9781680508468
  • 相關分類: Go 程式語言
  • 立即出貨 (庫存=1)

買這商品的人也買了...

相關主題

商品描述

Programmers love Go because it is lightweight, easy to work with, and easy to read. Go gives you the benefits of dynamically typed languages (speed of development) while keeping the upsides of strongly typed languages (security and performance).

Go is a simple language, but programming in Go is about more than just mastering syntax. There's an art to using Go effectively. Squeeze out the full use of advanced networking and multi-core power for which Go was designed. Save precious coding hours with recipes that help you manage objects, collect garbage, and safely use memory. Tackle Unicode, concurrency, and serialization with ease.

All the clean, reusable solutions you need for a wide variety of problems common to Go development. Outfitted with these recipes, your next apps will be more polished and more maintainable than ever.

Start out by tackling time and see how the Go time packager provides types that will do most of the heavy lifting for you. Next, work on recipes tailored to the nuances of processing text, like normalizing strings to avoid bugs. From there, whip up some functions on-the-fly and store functions in variables and data structures.

Ever wondered why Go seems to be peppered with error handling? Working through the next recipes, you'll discover the benefits, which include more robust code. In the section on HTTP, you'll learn tricks like running multiple HTTP servers on the same port and setting timeouts. With concurrency recipes, you'll limit the number of goroutines to improve performance, give your code awareness of timeouts, and decide when to keep your code sequential instead of making it concurrent.

Throughout the book, you'll make Go sizzle following simple recipes and tweaking them to fit your own apps. Using tools like strong typing and concurrency primitives, build a Go codebase that stays maintainable at scale.

What You Need:

You should know the Go language syntax and have some experience in programming. You will need a Go SDK, a Git client, and for some of the chapters, a C compiler.

商品描述(中文翻譯)

程式設計師喜愛 Go,因為它輕量、易於使用且易於閱讀。Go 給予你動態類型語言的優勢(開發速度),同時保留強類型語言的好處(安全性和效能)。

Go 是一種簡單的語言,但在 Go 中編程不僅僅是掌握語法。有效使用 Go 是一門藝術。充分發揮 Go 設計的高級網路和多核心性能。利用這些食譜節省寶貴的編碼時間,幫助你管理物件、收集垃圾並安全地使用記憶體。輕鬆處理 Unicode、併發和序列化。

你所需的所有乾淨、可重用的解決方案,適用於 Go 開發中常見的各種問題。配備這些食譜,你的下一個應用程式將比以往更精緻且更易於維護。

首先處理時間,看看 Go 的時間包裝器如何提供大多數繁重工作的類型。接下來,針對處理文本的細微差別,研究一些食譜,例如標準化字串以避免錯誤。然後,隨時編寫一些函數,並將函數儲存在變數和資料結構中。

你是否曾經想過為什麼 Go 似乎充滿了錯誤處理?在接下來的食譜中,你將發現其好處,包括更健壯的程式碼。在 HTTP 章節中,你將學習一些技巧,例如在同一端口上運行多個 HTTP 伺服器和設置超時。透過併發食譜,你將限制 goroutines 的數量以提高效能,讓你的程式碼意識到超時,並決定何時保持程式碼的順序而不是使其併發。

在整本書中,你將遵循簡單的食譜使 Go 變得生動,並調整它們以適應自己的應用程式。使用強類型和併發原語等工具,構建一個在規模上仍然可維護的 Go 代碼庫。

你需要的條件:
你應該了解 Go 語言的語法並具備一些編程經驗。你將需要一個 Go SDK、一個 Git 客戶端,以及在某些章節中需要一個 C 編譯器。