Golang Project Structure

Tutorials, tips and tricks for writing and structuring code in Go (with additional content for other programming languages)

Companies Using Go Code in Production Right Now

Three plastic credit cards and debit cards. One of them is an American Express card, another is a Visa card and the third is a MasterCard.

We spend a lot of time on this blog thinking about things like syntax and code style, or building example projects, but today I want to zoom out and look at Go programming from a bigger perspective. Who Uses Go in Real-World Applications? Since Go is one of the most popular languages being used in […]

How to Make Go Structs More Efficient

A small yellow car is shown in a huge parking space. Either side of it are two huge white buses.

It may be surprising to learn that two Go structs can contain exactly the same fields and yet one can require more — or less — memory than the other. Since we generally want to ensure that we never use more memory than required, we are going to look at a technique called structure packing […]

Cheat Sheet for the Vim Text Editor: Commands and Keys

The Vim text editor running on the Windows operating system.

Not everyone likes to write code using impressive IDEs. Many experienced programmers prefer to use the old-school Vim text editor, which runs natively in the Linux terminal. There are also versions available for Windows and MacOS. Although Vim has a reputation for being intimidating to new users, it offers an incredible degree of control and […]

Guide to Printing to the Console in Go

A row of wooden letters spelling out the word "format".

Most programs will need to emit some kind of output if they’re going to be useful to the people using them. So today we will look at the various ways to print content to the console in Go, focusing on four related functions in particular. Introducing the Fmt Package The Go standard library’s functions for […]

Did You Know That Slices in Go Can Take Three Indices?

Three cute cats sitting in a row.

I’m going to show you a little snippet of syntax today that even many experienced Go programmers may not be aware exists, which involves performing an operation on an array or slice with the use of three different indices. We’ll look in more detail at this special syntax that’s used in a slice-indexing operation below. […]

Why Ezoic Is the Best Ad Network To Make Money From Content Online

You may have seen the advertisements that are automatically placed into various sections on many of the pages of this website. The team at Ezoic handles all that for me, allowing me to focus on writing about the things that I care about and sharing what I’ve learnt about coding with other Go developers. So […]

Rob Pike’s Go Proverbs (Part One)

Rob Pike, one of the creators of the Go programming language.

This post is the start of an upcoming three-part series that will explain nineteen Go proverbs. In this context, the word “proverb” is just used as a fancier term for a “short, snappy saying”. The proverbs that we’ll be discussing come from a talk given by Rob Pike in the early days of Go. Rob […]

How to Determine if a Year Is a Leap Year

Not all years are of the same length — some are shorter or longer than others — so if you’re writing code that deals with dates and durations, it may be important to take account of this. What Is a Leap Year? In the Gregorian calendar, a leap year has 366 days, whereas other years […]