Go tools
Go comes with a series of useful tools to ease the development process every day. Also in the golang page of GitHub, there are some tools that are supported by the Go team but they are not part of the compiler.
Most of the projects use tools such as gofmt
so that all the code base looks similar. Godoc helps us to find useful information in Go's documentation and the goimport
command to auto-import the packages we are using. Let's see them.
The golint tool
A linter analyzes source code to detect errors or improvements. The golint
linter is available on
https://github.com/golang/lint for installation (it doesn't come bundled with the compiler). It is very easy to use and is integrated some IDEs to be run when you save a source code file (Atom or Sublime Text, for example). Do you remember the implicit/explicit code that we run when talking about variables? Let's lint it:
//Explicitly declaring a "string" variable var explicit string = "Hello, I'm a explicitly declared variable...