Hands-On Dependency Injection in Go

Explore various dependency injection methods in Go such as monkey patching, constructor injection, and method injection

Hands-On Dependency Injection in Go

Corey Scott

1 customer reviews
Explore various dependency injection methods in Go such as monkey patching, constructor injection, and method injection
Packt Subscription
FREE
$9.99/m after trial
eBook
$10.00
RRP $31.99
Save 68%
Print + eBook
$39.99
RRP $39.99
What do I get with a Packt subscription?
  • Exclusive monthly discount - no contract
  • Unlimited access to entire Packt library of 6500+ eBooks and Videos
  • 120 new titles added every month, on new and emerging tech
What do I get with an eBook?
  • Download this book in EPUB, PDF, MOBI formats
  • DRM FREE - read and interact with your content when you want, where you want, and how you want
  • Access this title in the subscription reader
What do I get with Print & eBook?
  • Get a paperback copy of the book delivered to you
  • Download this book in EPUB, PDF, MOBI formats
  • DRM FREE - read and interact with your content when you want, where you want, and how you want
  • Access this title in the subscription reader
What do I get with a Video?
  • Download this Video course in MP4 format
  • DRM FREE - read and interact with your content when you want, where you want, and how you want
  • Access this title in the subscription reader
$0.00
$10.00
$39.99
$9.99 p/m after trial
RRP $31.99
RRP $39.99
Subscription
eBook
Print + eBook
Start a FREE 10-day trial

Frequently bought together


Hands-On Dependency Injection in Go Book Cover
Hands-On Dependency Injection in Go
$ 31.99
$ 10.00
Hands-On GUI Application Development in Go Book Cover
Hands-On GUI Application Development in Go
$ 35.99
$ 10.00
Buy 2 for $20.00
Save $47.98
Add to Cart

Book Details

ISBN 139781789132762
Paperback346 pages

Book Description

Hands-On Dependency Injection in Go takes you on a journey, teaching you about refactoring existing code to adopt dependency injection (DI) using various methods available in Go.

Of the six methods introduced in this book, some are conventional, such as constructor or method injection, and some unconventional, such as just-in-time or config injection. Each method is explained in detail, focusing on their strengths and weaknesses, and is followed with a step-by-step example of how to apply it. With plenty of examples, you will learn how to leverage DI to transform code into something simple and flexible. You will also discover how to generate and leverage the dependency graph to spot and eliminate issues. Throughout the book, you will learn to leverage DI in combination with test stubs and mocks to test otherwise tricky or impossible scenarios.

Hands-On Dependency Injection in Go takes a pragmatic approach and focuses heavily on the code, user experience, and how to achieve long-term benefits through incremental changes.

By the end of this book, you will have produced clean code that’s easy to test.

Table of Contents

What You Will Learn

  • Understand the benefits of DI
  • Explore SOLID design principles and how they relate to Go
  • Analyze various dependency injection patterns available in Go
  • Leverage DI to produce high-quality, loosely coupled Go code
  • Refactor existing Go code to adopt DI
  • Discover tools to improve your code’s testability and test coverage
  • Generate and interpret Go dependency graphs

Authors

Table of Contents

Book Details

ISBN 139781789132762
Paperback346 pages
Read More
From 1 reviews

Read More Reviews

Recommended for You

Hands-On GUI Application Development in Go Book Cover
Hands-On GUI Application Development in Go
$ 35.99
$ 10.00
Hands-On Serverless Applications with Go Book Cover
Hands-On Serverless Applications with Go
$ 35.99
$ 10.00
Hands-On Go Programming Book Cover
Hands-On Go Programming
$ 23.99
$ 10.00
TypeScript 3.0 Quick Start Guide Book Cover
TypeScript 3.0 Quick Start Guide
$ 23.99
$ 10.00
Hands-On Full Stack Development with Go Book Cover
Hands-On Full Stack Development with Go
$ 31.99
$ 10.00
Hands-On Blockchain Development in 7 Days Book Cover
Hands-On Blockchain Development in 7 Days
$ 19.99
$ 10.00