Category Archives: Go

Go – about errors .

The golang come with a fair amount of functions end up returning errors like values. The golang errors functions looking like this:

You can use the errors package and that implements functions to manipulate errors. The official golang example:

You can see how is created the new custom errors using the New function:… Read More »

Go – simple or not.

In this tutorial I will show you how important it is to read the documentation in programming. I’ll start with a simple command to detect the go language version

Most will say there are improvements and it is normal to know them. Some of them will think that implementation is not obvious at a… Read More »

Go – About goimport tool .

A Go developer know the code must be formatted with standard gofmt tool. While gofmt attracks much attention, goimport is overlooked despite often being more useful. Basically, goimport does everything that gofmt do. First, you need to install into go using:

This will auto import Go packages using goimports tool. While correcting, goimports removes… Read More »