Go workspaces
In Go 1.18, the Go workspaces feature was released, which improved the experience of working with multiple Go
modules within the same project locally. Originally, when working with multiple Go modules in the same project, you would need to manually edit the Go module files for each module with the replace directive to use your local changes. Now, with Go workspaces, we can define a go.work
file, specifying to use our local changes, and not have to worry about managing several go.mod
files manually ourselves. This is particularly useful when working with larger projects, or projects that span multiple repositories.
Exercise 09.03 – working with workspaces
In this exercise, we will look at what it used to be like when working with projects that had multiple Go modules that needed their dependencies to be replaced so that they could use local changes. We will then update the example code so that it uses Go workspaces to show the improvements:
- Create...