Book description
Start Writing Production-Ready Go Code Fast
Thousands of developers and teams want to start taking advantage of Go, the powerful language used in projects ranging from Kubernetes to Docker and Vault. Go Fundamentals is specifically designed to get you up-to-speed fast, to leverage your existing knowledge of other languages, and to help you avoid common mistakes made by Go newcomers.
Based on author Mark Bates's and Cory LaNou's pioneering Gopher Guides training curricula, this guide will allow you to quickly understand and use Go syntax, core features, and idioms. Reflecting Go through version 1.18--which includes Go's exciting new support for generics--this guide prepares you to write robust, reliable, well-performing production code right from the outset.
Learn how Go manages packages, modules, and dependencies
Apply Go basics, such as variable declaration, types, and control flow
Work effectively with collection types, iteration, functions, structs, and pointers
Understand Go Slices and use them properly
Write idiomatic Go, using principles such as embedding and composition
Expertly use concurrency to improve code performance
Create proper tests to quickly identify and fix problems
Write simpler, better code with generics and interfaces
Take advantage of channels, context, sync primatives, and other advanced features
Go is lightweight, simple, and perfect for modern cloud-native and microservices development, which is why Go developers are in such high demand. With this guide and six months' experience with any modern programming language, you'll have what you need to leap into Go programming.
Register your book for convenient access to downloads, updates, and/or corrections as they become available. See inside book for details.
Table of contents
- Cover Page
- About This eBook
- Halftitle Page
- Title Page
- Copyright Page
- Pearson’s Commitment to Diversity, Equity, and Inclusion
- Dedication Page
- Contents
- Foreword
- Preface
- Acknowledgments
- About the Authors
- 1. Modules, Packages, and Dependencies
- 2. Go Language Basics
- 3. Arrays, Slices, and Iteration
- 4. Maps and Control Structures
- 5. Functions
- 6. Structs, Methods, and Pointers
- 7. Testing
-
8. Interfaces
- Concrete Types versus Interfaces
- Explicit Interface Implementation
- Implicit Interface Implementation
- Before Interfaces
- Using Interfaces
- Implementing io.Writer
- Multiple Interfaces
- Asserting Interface Implementation
- The Empty Interface
- The any Keyword
- Defining Interfaces
- Embedding Interfaces
- Type Assertion
- Assertions through Switch
- Using Assertions
- Summary
- 9. Errors
- 10. Generics
- 11. Channels
- 12. Context
- 13. Synchronization
-
14. Working with Files
- Directory Entries and File Information
- Walking Directories
- Skipping Directories and Files
- Creating Directories and Subdirectories
- File Path Helpers
- Creating Multiple Directories
- Creating Files
- Fixing the Walk Tests
- Appending to Files
- Reading Files
- Beware of Windows
- The FS Package
- Using the FS Interface
- Mocking a File System
- Embedding Files
- Summary
- Index
- Code Snippets
Product information
- Title: Go Fundamentals: Gopher Guides
- Author(s):
- Release date: November 2022
- Publisher(s): Addison-Wesley Professional
- ISBN: 9780137918416
You might also like
book
Kubernetes: Up and Running, 3rd Edition
This third edition comes with a dedicated playlist of interactive Katacoda labs mapped to each section …
video
Getting Started with Kubernetes LiveLessons, 2nd Edition
6+ Hours of Video Instruction An updated edition of this video title is available. Please go …
video
Kubernetes for the Absolute Beginners - Hands-On
Starting from the fundamental concept of containers, the course gradually unfolds into a comprehensive guide on …
book
Terraform: Up and Running, 3rd Edition
Terraform has become a key player in the DevOps world for defining, launching, and managing infrastructure …