Book Image

Go Programming Blueprints

By : Mat Ryer
Book Image

Go Programming Blueprints

By: Mat Ryer

Overview of this book

Table of Contents (17 chapters)
Go Programming Blueprints
Credits
About the Author
Acknowledgments
About the Reviewers
www.PacktPub.com
Preface
Index

Appendix A. 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 again, 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:

  • Get the Go source code and build it natively on your development machine

  • Learn what the GOPATH environment variable is for, and discuss a sensible approach to its use

  • Learn 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 development