Relying on your tests
We now have a good understanding of how to refactor our code and have learned how to take advantage of some of Go’s best features: the compiler and interfaces. This should make your refactoring much easier and help you fit it into your sprint planning. In this section, we will have a look at a couple of examples of code refactors in the BookSwap
application that will allow us to use all the techniques we have explored in this chapter.
Automated refactoring
One of the biggest strengths of Go is its tooling, and IDE support is no exception to this:
- The Google Go team maintains an extension for Go development in Visual Studio Code (https://code.visualstudio.com/docs/languages/go)
- The
vim-go
plugin (https://github.com/fatih/vim-go) is a popular open source plugin maintained by the Go community - The team at JetBrains has created GoLand (https://www.jetbrains.com/go/), which is a dedicated product for Go development
All of these IDEs...