Golang Project Structure

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

go programming

Tag

Some Findings From the 2021 Go Developer Survey

For the past six years, Google has run an annual Go Developer Survey in order to understand more about what the community thinks and how it feels about recent changes to the language. The survey also helps to keep us informed about any problems or concerns that have arisen and gives us an opportunity to […]

Removing Elements From a Slice

I’ve written in the past about how to reverse the order of all the elements in a slice, but today I’m going to discuss some of the ways that elements can be removed — in other words, deleted — from a slice in Go. When looking at the various ways to remove one or more […]

Basic NLP (Natural Language Processing) With Prose

No matter how many programming languages you learn, you will almost certainly never know them as well and as instinctively as your natural language. Even though it may not always seem to be the case when you’re dealing with a difficult programming problem, the English language is much more complicated than Golang: its vocabulary is […]

Lux Makes Downloading Videos Extremely Easy

Have you ever been watching a video and wanted to download it, so you can watch it again offline or on another device? I’m going to show you something that should be able to help you do just that: Lux is a really handy little command-line application that has been built in Go and it […]

A Super Speed-up With Binary Search

In any programming language, there are two main algorithms used for finding a given value in an array: linear search and binary search. (Just to note: in Go, we generally use slices rather than arrays, but I’ll use those two terms interchangeably in this post, just for the sake of simplicity, since everything that I […]

Representing Money in the Go Programming Language

If you’re building a web app or program that handles sales from customers, you may need to find a reliable way of representing money in Golang. There’s no single way to do it, since the language does not have a primitive type that is intended to hold monetary values. In this post, I will go […]

Creating Cool Games With Ebiten

The Ebiten game framework was written by Japanese software engineer Hajime Hoshi. The framework is designed to make it easier for Go programmers to create native-looking 2D games, by taking care of all the boilerplate code for us. (Note that since I first wrote this post, Ebiten has been renamed to Ebitengine.) Installing the Ebiten […]

What We’ve Been Waiting For: Generics in Go

Climbing ropes in a children's playground.

It’s been a long time coming and it’s caused a certain degree of controversy among Gophers, but now we know, at last, that it’s really happening. Generics have been included in a beta version of Go 1.18, which was just released this week. What Are Generics? In a strictly typed language like Go, every argument […]