Go

Understanding defer in Go — step-by-step Programming tutorial on Progressive Robot

Understanding defer in Go

Go has many of the common control flow keywords found in other programming languages such as if, switch, for, etc. One keyword that isn’t found in most other programming languages is defer, and though it’s less common you’ll quickly see how useful it can be in your programs. In this article we will learn how to properly use the defer statement for cleaning up resources as well as several common mistakes that are made when using defer.

Read more
Understanding Pointers in Go — step-by-step Programming tutorial on Progressive Robot

Understanding Pointers in Go

When writing software in Go you’ll be writing functions and methods. You pass data to these functions as arguments. Sometimes, the function needs a local copy of the data, and you want the original to remain unchanged. In this article, you will learn how to create and use pointers to share access to the memory space for a variable.

Read more
Personalizando binários em Go com build tags — step-by-step Programming tutorial on Progressive Robot

Personalizando binários em Go com build tags

No Go, um build tag, ou uma restrição de compilação, é um identificador adicionado a um pedaço de código que determina quando o arquivo deve ser incluído em um pacote durante o processo de build. Isso permite que você compile diferentes versões de seu aplicativo em Go a…

Read more
Handling Errors in Go — step-by-step Programming tutorial on Progressive Robot

Handling Errors in Go

Robust code needs to react correctly to unexpected circumstances like bad user input, faulty network connections, and failing disks. Error handling is the process of identifying when your program is in an unexpected state, and taking steps to record diagnostic information for later debugging.

Read more
CHAT