Book description
Master key features of Go, including advanced concepts like concurrency and working with JSON, to create and optimize real-world services, network servers, and clients
Key Features
- This third edition of the bestselling guide to advanced Go programming has been overhauled and expanded to cover RESTful servers, the WebSocket protocol, and Go generics
- Use real-world exercises to build high-performance network servers and powerful command line utilities
- Packed with practical examples and utilities to apply to your own development work and administrative tasks
- Get clear explanations about Go nuances and features to simplify Go development
Book Description
Mastering Go is the essential guide to putting Go to work on real production systems. This freshly updated third edition includes topics like creating RESTful servers and clients, understanding Go generics, and developing gRPC servers and clients.
Mastering Go was written for programmers who want to explore the capabilities of Go in practice. As you work your way through the chapters, you'll gain confidence and a deep understanding of advanced Go concepts, including concurrency and the operation of the Go Garbage Collector, using Go with Docker, writing powerful command-line utilities, working with JavaScript Object Notation (JSON) data, and interacting with databases. You'll also improve your understanding of Go internals to optimize Go code and use data types and data structures in new and unexpected ways.
This essential Go programming book will also take you through the nuances and idioms of Go with exercises and resources to fully embed your newly acquired knowledge.
With the help of Mastering Go, you'll become an expert Go programmer by building Go systems and implementing advanced Go techniques in your projects.
What you will learn
- Use Go in production
- Write reliable, high-performance concurrent code
- Manipulate data structures including slices, arrays, maps, and pointers
- Develop reusable packages with reflection and interfaces
- Become familiar with generics for effective Go programming
- Create concurrent RESTful servers, and build gRPC clients and servers
- Define Go structures for working with JSON data
Who this book is for
You'll need to know the basics of Go before you get started with this book, but beyond that, anyone can sink their teeth into it. It's written primarily for Go programmers who have a bit of experience with the language and want to become expert practitioners.
Table of contents
- Preface
- A Quick Introduction to Go
- Basic Go Data Types
- Composite Data Types
- Reflection and Interfaces
- Go Packages and Functions
-
Telling a UNIX System What to Do
- stdin, stdout, and stderr
- UNIX processes
- Handling UNIX signals
- File I/O
- Reading text files
- Writing to a file
- Working with JSON
- Working with XML
- Working with YAML
- The viper package
- The cobra package
- Finding cycles in a UNIX file system
- New to Go 1.16
- Updating the phone book application
- Exercises
- Summary
- Additional resources
-
Go Concurrency
- Processes, threads, and goroutines
- The Go scheduler
- Goroutines
- Channels
- Race conditions
- The select keyword
- Timing out a goroutine
- Go channels revisited
- Shared memory and shared variables
- Closured variables and the go statement
- The context package
- The semaphore package
- Exercises
- Summary
- Additional resources
- Building Web Services
- Working with TCP/IP and WebSocket
- Working with REST APIs
- Code Testing and Profiling
- Working with gRPC
- Go Generics
- Appendix A – Go Garbage Collector
- Other Books You May Enjoy
- Index
Product information
- Title: Mastering Go - Third Edition
- Author(s):
- Release date: August 2021
- Publisher(s): Packt Publishing
- ISBN: 9781801079310
You might also like
book
Mastering Go - Second Edition
Publisher's Note: This edition from 2019 is outdated and is not compatible with the latest version …
video
Mastering Go Programming
Go has moved from the state of tentative to mass adoption. Its C-like speed, simplicity, and …
book
Mastering TypeScript - Fourth Edition
Learn all you need to know to work with TypeScript, explore modern web application frameworks, and …
video
Ultimate Go Programming, Second Edition
An updated edition of this video title is available. Please go to Ultimate Go: Advanced Concepts …