Golang Project Structure

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

Reversing a String

This post will look at various ways to reverse a string in Go, a fairly common task that isn’t explicitly handled by the standard library. We will start by looking at some basic examples using Java and the Linux command line, then we will go through various ways to code solutions to the problem in […]

Functional Programming With Slices

This post will explore the programming paradigm known as functional programming and discuss what restrictions it places on programmers, as well as how it helps in the process of developing and structuring code. We will then go through some practical examples of functional-style code written in Go, specifically looking at how generic functions can be […]

The Best Golang Task Runner

Okay, I’m biased — it’s my task runner — but hear me out. This post will start by discussing what a task runner actually is and exploring how it works by building a very basic version of one in Go code. Then we’ll look at some example tasks that can be completed with the help […]

Living Through the Crypto Crash

I want to discuss the recent crypto crash and its potential implications, so I’m going to take a short diversion from my usual approach of providing programming advice and code examples with this post. Understandably, the rapid fall in the valuations of cryptocurrencies is a topic that interests many of us who work in the […]

How to Read a File Line by Line

Sometimes you want to read a file that contains many lines of text or a list of structured data and you want to process each line individually, rather than working with the entire content of the file at once. This post will discuss various ways to read a file line by line, looking first at […]

Hash Functions in Go

This post will explain what hash functions are and how they’re used. We will then go on to look at some examples of hashing algorithms in Go code. Finally, we will look at importing external packages that export hash functions, including from the standard library. What Is a Hash Function? A hash function takes data […]

Creating My First WordPress Plugin With JavaScript

This post will document my very first foray into developing a WordPress plugin, which is used on this website. The majority of the code is contained within a single JavaScript file. Why Do I Use WordPress? The blog runs on WordPress. I’ve created other websites and blogs in the past for which I wrote all […]

How to Concatenate Slices

Slices are one of the most important data structures used in Go. In this post, we will look at how to concatenate slices. We will start by explaining the general concept of concatenation, then we will look at examples of concatenating two or more slices in Go. Finally, we will build functions that can help […]