Exploring the details of the project we want to write tests for

For the purpose of demonstrating the creation and use of mocks in our code, we will be working with the example code from the Chapter04/dependency package. This package defines a Collector type whose purpose is to assemble a set of direct and indirect (transitive) dependencies for a given project ID. To make things a bit more interesting, let's assume that each dependency can belong to one of the following two categories:

  • A resource that we need to include (for example, an image file) or reserve (for example, a block of memory or an amount of disk space)
  • Another project with its own set of dependencies

To obtain the list of direct dependencies and their respective types, the ...

Get Hands-On Software Engineering with Golang now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.