chapter eleven

11 Working with larger projects

 

This chapter covers

  • Organizing code with packages and modules
  • Designing a shared domain model using interfaces
  • Coordinating multiple modules during development with workspaces
  • Building a multimodule application

Throughout this book, we have built several small applications to demonstrate various parts and patterns of the Go programming language. For the most part, these applications have been self-contained, relying on the standard library packages we explored in previous chapters and custom packages we wrote ourselves. In everyday development, though, this is rarely the case. Developers routinely use shared libraries to support their projects. Unlike the standard library, these external libraries are managed by individuals or small teams rather than undergoing a standardization process that requires community consensus.

Beyond external libraries, applications interact with external services through clients and APIs. Documenting and managing these dependencies can be challenging but is essential in most workflows.

11.1 Modules

11.1.1 Packages

11.1.2 Domain module: Shared domain model

11.2 Versioning modules

11.3 Workspaces

11.3.1 Understanding workspaces

11.3.2 API module: REST service

11.3.3 Worker module: Background feed fetcher

11.3.4 Testing the complete system

11.3.5 Versioning independent modules

11.3.6 Workspace benefits demonstrated

Summary