Appendix Appendix. Good Practices for a Stable Go Environment
Writing Go code is a fun and enjoyable experience, where compile-time errors rather than being a pain actually guide you to write robust, high-quality code. However, every now and then, you will encounter environmental issues that start to get in the way and break your flow. While you can usually resolve these issues after some searching and a little tweaking, setting up your development environment correctly goes a long way in reducing problems, allowing you to focus on building useful applications.
In this chapter, we are going to install Go from scratch on a new machine and discuss some of the environmental options we have and the impact they might have in the future. We will also consider how collaboration might influence some of our decisions as well as what impact open sourcing our packages might have.
Specifically, we are going to:
Install Go on your development machine
Learn what the
GOPATH
environment variable is for and discuss a sensible approach for its useLearn about the Go tools and how to use them to keep the quality of our code high
Learn how to use a tool to automatically manage our imports
Think about on save operations for our
.go
files and how we can integrate the Go tools as part of our daily developmentLook at some popular code editor options to write Go code