Powerful Command-Line Applications in Go: Build Fast and Maintainable Tools
暫譯: 使用 Go 建立強大的命令列應用程式:快速且可維護的工具
Gerardi, Ricardo
- 出版商: Pragmatic Bookshelf
- 出版日期: 2022-01-11
- 售價: $1,600
- 貴賓價: 9.5 折 $1,520
- 語言: 英文
- 頁數: 250
- 裝訂: Paperback
- ISBN: 168050696X
- ISBN-13: 9781680506969
-
相關分類:
Go 程式語言
立即出貨 (庫存 < 3)
買這商品的人也買了...
-
無瑕的程式碼-敏捷完整篇-物件導向原則、設計模式與 C# 實踐 (Agile principles, patterns, and practices in C#)$790$616 -
Working Effectively with Legacy Code : 管理、修改、重構遺留程式碼的藝術 (中文版)$720$562 -
$477Rust 權威指南 (The Rust Programming Language (Covers Rust 2018)) -
再強一點:用 Go語言完成六個大型專案$780$616 -
$1,400Network Programming with Go: Learn to Code Secure and Reliable Network Services from Scratch -
黑帽 Python|給駭客與滲透測試者的 Python 開發指南, 2/e (Black Hat Python : Python Programming for Hackers and Pentesters, 2/e)$450$356 -
Spring REST API 開發與測試指南|使用 Swagger、HATEOAS、JUnit、Mockito、PowerMock、Spring Test$580$493 -
Linux 網路內功修煉 - 徹底了解底層原理及高性能架構$780$663 -
演算法生存指南(書況差限門市銷售)$800$632 -
從 Hooks 開始,讓你的網頁 React 起來 (第二版)(iT邦幫忙鐵人賽系列書)$720$562 -
哎呀!不小心刻了一套 React UI 元件庫 : 從無到有輕鬆上手(iThome鐵人賽系列書)$650$507 -
The Rust Programming Language, 2/e (Paperback)$1,800$1,710 -
哎呀!原來 React 這麼有趣好玩:圈叉、貪吃蛇、記憶方塊三款經典遊戲實戰練習(iThome鐵人賽系列書)$620$484 -
Smaller C|用於小型機器之精實程式碼 (Smaller C: Lean Code for Small Machines)$680$537 -
白話機器學習$780$616 -
React 思維進化:一次打破常見的觀念誤解,躍升專業前端開發者(iThome鐵人賽系列書)【軟精裝】$790$616 -
Python 風格徹底研究|超詳實、好理解的 Python 必學主題 (Dead Simple Python)$980$774 -
遞迴演算法大師親授面試心法:Python 與 JavaScript 解題全攻略 (The Recursive Book of Recursion)$680$530 -
建構機器學習系統實踐指南$620$490 -
機器學習的訓練資料 (Training Data for Machine Learning)$780$616 -
資料工程基礎|規劃和建構強大、穩健的資料系統 (Fundamentals of Data Engineering)$980$774 -
讓 AI 好好說話!從頭打造 LLM (大型語言模型) 實戰秘笈$680$537 -
日式 RPG 編年史:從 DQ 到 FF,角色扮演遊戲敘事手法完全剖析$380$300 -
軟體工程師的英語使用守則:English for Developers$420$357 -
內行人才知道的系統設計面試指南 第二輯 (System Design Interview – An Insider's Guide: Volume 2)$820$648
商品描述
Whether you want to automate tasks, analyze data, parse logs, talk to network services, or address other systems requirements, writing your own command-line tool may be the fastest - and perhaps the most fun - way to do it. The Go programming language is a great choice for developing tools that are fast, reliable, and cross-platform. Create command-line tools that work with files, connect to services, and even manage external processes, all while using tests and benchmarks to ensure your programs are fast and correct.
When you want to develop cross platform command-line tools that are fast and reliable, use Go, a modern programming language that combines the reliability of compiled languages with the ease of use and flexibility of dynamic typed languages. Work through practical examples to develop elegant and efficient tools by applying Go's rich standard library, its built in support for concurrency, and its expressive syntax. Use Go's integrated testing capabilities to automatically test your tools, ensuring they work reliably even across code refactoring.
Develop CLI tools that interact with your users by using common input/output patterns, including environment variables and flags. Handle files to read or persist data, and manipulate paths consistently in cross-platform scenarios. Control processes and handle signals, and use a benchmark driven approach and Go's concurrency primitives to create tools that perform well. Use powerful external libraries such as Cobra to create modern and flexible tools that handle subcommands, and develop tools that interact with databases, APIs, and network services. Finally, leverage what you learned by tackling additional challenges at the end of each chapter.
What You Need:
Go 1.8 or higher, an internet connection to download the example files and additional libraries, and a text editor to write your programs.
商品描述(中文翻譯)
無論您想自動化任務、分析數據、解析日誌、與網絡服務交互,或滿足其他系統需求,編寫自己的命令行工具可能是最快的方式——也許還是最有趣的方式。Go 程式語言是開發快速、可靠且跨平台工具的絕佳選擇。創建與文件交互、連接服務,甚至管理外部進程的命令行工具,同時使用測試和基準來確保您的程式快速且正確。
當您想開發快速且可靠的跨平台命令行工具時,使用 Go,這是一種現代程式語言,結合了編譯語言的可靠性與動態類型語言的易用性和靈活性。通過實際範例,應用 Go 的豐富標準庫、內建的並發支持和表達性語法,開發優雅且高效的工具。利用 Go 的集成測試功能自動測試您的工具,確保它們在代碼重構後仍能可靠運行。
開發與用戶互動的 CLI 工具,使用常見的輸入/輸出模式,包括環境變數和標誌。處理文件以讀取或持久化數據,並在跨平台場景中一致地操作路徑。控制進程和處理信號,並使用基準驅動的方法和 Go 的並發原語來創建性能良好的工具。使用強大的外部庫,如 Cobra,來創建現代且靈活的工具,處理子命令,並開發與數據庫、API 和網絡服務交互的工具。最後,利用您所學的知識,通過在每章結尾解決額外挑戰來加強學習。
您需要的條件:
Go 1.8 或更高版本,連接互聯網以下載範例文件和其他庫,以及一個文本編輯器來編寫您的程式。
作者簡介
Ricardo Gerardi is an IT professional with over 20 years experience in large and small companies. He's currently working as Automation Consultant at Red Hat. Ricardo has been developing command line tools for a long time, for different purposes including automation, monitoring, and data analysis tools, and he has now adopted Go for all his projects.
作者簡介(中文翻譯)
Ricardo Gerardi 是一位擁有超過 20 年經驗的 IT 專業人士,曾在大型和小型公司工作。他目前在 Red Hat 擔任自動化顧問。Ricardo 長期以來一直在開發命令列工具,這些工具用於自動化、監控和數據分析等不同目的,現在他已經在所有項目中採用了 Go。
目錄大綱
What’s in This Book
How to Use This Book
About Example Code
Go Modules
Online Resources
Your First Command Line Program in Go excerpt
Building the Basic Word Counter
Testing the Basic Word Counter
Adding Command Line Flags
Compiling your Tool for Different Platforms
Exercises
Interacting with Your Users
Organizing your Code
Defining the To-Do API
Creating the Initial To-Do Command Line Tool
Testing the Initial CLI Implementation
Handling Multiple Command Line Options
Display Command Line Tool Usage
Improving the List Output Format
Increasing Flexibility with Environment Variables
Capturing Input from STDIN
Exercises
Working with Files in Go
Creating a Basic Markdown Preview Tool
Writing Tests for the Markdown Preview Tool
Adding Temporary Files to the Markdown Preview Tool
Using Interfaces to Automate Tests
Adding an Auto-Preview Feature
Cleaning Up Temporary Files
Improving the Markdown Preview Tool with Templates
Exercises
Navigating the File System
Developing a File System Crawler
Testing with Table Driven Testing
Deleting Matched Files
Testing with the Help of Test Helpers
Logging Deleted Files
Archiving Files
Exercises
Improving the Performance of your CLI Tools
Developing the Initial Version of colStats
Writing Tests for ColStats
Benchmarking your Tool
Profiling your Tool
Reducing Memory Allocation
Tracing your Tool
Improving the colStats Tool to Process Files Concurrently
Reduce Scheduling Contention
Exercises
Controlling Processes
Executing External Programs
Writing tests for Goci
Defining a Pipeline
Adding Another Step to the Pipeline
Handling Output from External Programs
Running Commands with Contexts
Integration Tests with a Local Git Server
Testing Commands with Mock Resources
Handling Signals
Exercises
Talking to REST APIs
Using the Cobra CLI Framework
Developing Interactive Terminal Tools
Working with Regular Expressions in Go
Distributing Your Tool
目錄大綱(中文翻譯)
What’s in This Book
How to Use This Book
About Example Code
Go Modules
Online Resources
Your First Command Line Program in Go excerpt
Building the Basic Word Counter
Testing the Basic Word Counter
Adding Command Line Flags
Compiling your Tool for Different Platforms
Exercises
Interacting with Your Users
Organizing your Code
Defining the To-Do API
Creating the Initial To-Do Command Line Tool
Testing the Initial CLI Implementation
Handling Multiple Command Line Options
Display Command Line Tool Usage
Improving the List Output Format
Increasing Flexibility with Environment Variables
Capturing Input from STDIN
Exercises
Working with Files in Go
Creating a Basic Markdown Preview Tool
Writing Tests for the Markdown Preview Tool
Adding Temporary Files to the Markdown Preview Tool
Using Interfaces to Automate Tests
Adding an Auto-Preview Feature
Cleaning Up Temporary Files
Improving the Markdown Preview Tool with Templates
Exercises
Navigating the File System
Developing a File System Crawler
Testing with Table Driven Testing
Deleting Matched Files
Testing with the Help of Test Helpers
Logging Deleted Files
Archiving Files
Exercises
Improving the Performance of your CLI Tools
Developing the Initial Version of colStats
Writing Tests for ColStats
Benchmarking your Tool
Profiling your Tool
Reducing Memory Allocation
Tracing your Tool
Improving the colStats Tool to Process Files Concurrently
Reduce Scheduling Contention
Exercises
Controlling Processes
Executing External Programs
Writing tests for Goci
Defining a Pipeline
Adding Another Step to the Pipeline
Handling Output from External Programs
Running Commands with Contexts
Integration Tests with a Local Git Server
Testing Commands with Mock Resources
Handling Signals
Exercises
Talking to REST APIs
Using the Cobra CLI Framework
Developing Interactive Terminal Tools
Working with Regular Expressions in Go
Distributing Your Tool