Go in Practice
Matt Butcher and Matt Farina
Foreword by Brian Ketelsen
  • August 2016
  • ISBN 9781633430075
  • 312 pages
  • printed in black & white

Vital knowledge that will help take your application development to the next level.

From the Foreword by Brian Ketelsen, Coauthor of "Go in Action"

Go in Practice guides you through 70 real-world techniques in key areas like package management, microservice communication, and more. Following a cookbook-style Problem/Solution/Discussion format, this practical handbook builds on the foundational concepts of the Go language and introduces specific strategies you can use in your day-to-day applications.

About the Technology

Go may be the perfect systems language. Built with simplicity, concurrency, and modern applications in mind, Go provides the core tool set for rapidly building web, cloud, and systems applications. If you know a language like Java or C#, it's easy to get started with Go; the trick is finding the practical dirt-under-the-fingernails techniques that you need to build production-ready code.

About the book

Go in Practice guides you through dozens of real-world techniques in key areas. Following a cookbook-style Problem/Solution/Discussion format, this practical handbook builds on the foundational concepts of the Go language and introduces specific strategies you can use in your day-to-day applications. You'll learn techniques for building web services, using Go in the cloud, testing and debugging, routing, network applications, and much more. After finishing this book, you will be ready to build sophisticated cloud-native Go applications.

Table of Contents detailed table of contents

Part 1: Background and Fundamentals

1. Getting in to Go

1.1. What is Go?

1.2. Noteworthy Aspects of Go

1.2.1. Multiple Return Values

1.2.2. A Modern Standard Library

1.2.3. Concurrency with goroutines and channels

1.2.4. Go the toolchain, more than a language

1.3. Go in the vast language landscape

1.3.1. C and Go

1.3.2. Go and Java

1.3.3. Python, PHP, and Go

1.3.4. JavaScript, node.js, and Go

1.4. Getting up and running in Go

1.4.1. Installing Go

1.4.2. Git, Mercurial, and Version Control

1.4.3. Workspace

1.4.4. Environment Variables

1.5. Hello Go

1.6. Summary

2. A Solid Foundation

2.1. CLI Applications, the Go Way

2.1.1. Command Line Flags

2.1.2. Command Line Frameworks

2.2. Handling Configuration

2.3. Working with Real World Web Servers

2.3.1. Starting up and shutting down a server

2.3.2. Routing Web Requests

2.4. Summary

3. Concurrency in Go

3.1. Understanding Go's Concurrency Model

3.2. Working with Goroutines

3.3. Working with Channels

3.4. Summary

Part 2: Well-Rounded Applications

4. Handling Errors and Panics

4.1. Error Handling

4.2. The Panic System

4.2.1. Differentiating panics from errors

4.2.2. Working with Panics

4.2.3. Recovering from Panics

4.2.4. Panics and Goroutines

4.3. Summary

5. Debugging and Testing

5.1. Locating Bugs

5.1.1. Wait, Where Is My Debugger?

5.2. Logging

5.2.1. Using Go’s Logger

5.2.2. Working with System Loggers

5.3. Accessing Stack Traces

5.4. Testing

5.4.1. Unit Testing

5.4.2. Generative Testing

5.5. Performance Tests and Benchmarks

5.6. Summary

Part 3: An interface for your applications

6. HTML and Email Template Patterns

6.1. Working with HTML templates

6.1.1. Standard library HTML package overview

6.1.2. Adding Functionality Inside Templates

6.1.3. Limiting template parsing

6.1.4. When template execution breaks

6.1.5. Mixing Templates

6.2. Using Templates for Email

6.3. Summary

7. Serving and Receiving, Assets and Forms

7.1. Serving static content

7.2. Handling Form Posts

7.2.1. Introduction to form requests

7.2.2. Working with files and miltipart submissions

7.2.3. Working with raw multipart data

7.3. Summary

8. Working with Web Services

8.1. Using REST APIs

8.1.1. Using The HTTP Client

8.1.2. When Faults Happen

8.2. Passing And Handling Errors Over HTTP

8.2.1. Generating Custom Errors

8.2.2. Reading And Using Custom Errors

8.3. Parsing And Mapping JSON

8.4. Versioning REST APIs

8.5. Summary

Part 4: Taking your applications to the cloud

9. Using the Cloud

9.1. What Is Cloud Computing?

9.1.1. The Different Types of Cloud

9.1.2. Containers and Cloud Native Applications

9.2. Managing Cloud Services

9.2.1. Avoid Cloud Provider Lock—in

9.2.2. Dealing with Divergent Errors

9.3. Running On Cloud Servers

9.3.1. Runtime Detection

9.3.2. Building For The Cloud

9.3.3. Runtime Monitoring

9.4. Summary

10. Communication Between Cloud Services

10.1. Microservices and High Availability

10.2. Communicating Between Services

10.2.1. Making REST Faster

10.2.2. Moving Beyond REST

10.3. Summary

11. Reflection and Code Generation

11.1. Three features of reflection

11.2. Structs, tags, and annotations

11.2.1. Annotating structs

11.2.2. Using tag annotations

11.3. Generating Go code with Go code

11.4. Summary

What's inside

  • Dozens of specific, practical Golang techniques
  • Using Go for devops and cloudops
  • Writing RESTful web services and microservices
  • Practical web dev techniques

About the reader

Written for experienced developers who have already started exploring Go and want to use it effectively in a production setting.

About the authors

Matt Farina is a Principal Engineer in the Advanced Technology Group at Hewlett Packard Enterprise. Matt Butcher is a software architect at Deis. They are both authors, speakers, and regular open source contributors.

placing your order...

Don't refresh or navigate away from the page.
print book $44.99 pBook + eBook + liveBook
Additional shipping charges may apply
Prints and ships within 3-5 days
Go in Practice (print book) added to cart
continue shopping
go to cart

eBook $35.99 3 formats + liveBook
Go in Practice (eBook) added to cart
continue shopping
go to cart

Prices displayed in rupees will be charged in USD when you check out.
customers also reading

This book 1-hop 2-hops 3-hops

FREE domestic shipping on three or more pBooks