Using ‘Go Generate’ To Deploy Multi-Process Apps

In microservice architectures, it is fairly common to have a project that includes different worker types. A Makefile can be used to manage the creation of multiple programs, but the Go toolchain has a great tool that can be used as well, go generate. Here are some examples of how we take advantage of ‘go … Read more Using ‘Go Generate’ To Deploy Multi-Process Apps

Use Anonymous Structs For JSON Marshalling in Go

Go is a language built for the web. The Go standard library comes with everything we need to stand up a production web server. Today we are going to explore marshaling JSON using anonymous structs. Anonymous structs can help keep API handlers clean and simple. What Is A Struct? Go’s structs are typed collections of fields. They’re … Read more Use Anonymous Structs For JSON Marshalling in Go

Quantum Programming 101: Superdense Coding Tutorial

By Macauley Coggins What is Superdense coding ? Superdense coding is a quantum communications protocol that allows a user to send 2 classical bits by sending only 1 qubit. The Protocol Step 1: Preparing the Bell Pair First a bell pair consisting of 2 qubits is prepared. Where q0 is the senders qubit and q1 … Read more Quantum Programming 101: Superdense Coding Tutorial

Announcing Go-TinyTime, Go-TinyDate’s Sister Package

time.Time is the perfect choice for most cases, it even comes in the standard library! The problem is that the time.Time{} struct uses more than 24 bytes of memory under most conditions. Go-TinyTime solves this problem by restricting the available dates to the range between 1970 – 2106, and only supporting UTC timezones. This brings … Read more Announcing Go-TinyTime, Go-TinyDate’s Sister Package

Golang Conversions – Ints To Strings And Strong Typing

Go is a strongly typed language, which means at any point a developer should know exactly what type of value they are dealing with. For example, if we have a function that prints a string, we can’t just give it an integer and expect it to work. We have to cast it to a string … Read more Golang Conversions – Ints To Strings And Strong Typing

How To Separate Library Packages in Go

I’ve often seen, and have been responsible for, throwing code into packages without much thought. I’ve quickly drawn a line in the sand and started putting code into different folders (which in Go are different packages by definition) just for the sake of findability. What is a Package? In Go, code is organized into packages. … Read more How To Separate Library Packages in Go

I Wrote Go-TinyDate, The Missing Golang Date Package

time.Time makes dealing with dates and times in Go a breeze, and it even comes bundled in the standard library! However, a time.Time{} struct uses more than 24 bytes of memory under most conditions, and I’ve run into situations where I need to store millions of them in memory, but all I really needed was … Read more I Wrote Go-TinyDate, The Missing Golang Date Package

Golang Mutexes – What Is RWMutex For?

Golang is King when it comes to concurrency. No other language has so many tools right out-of-the-box, and one of those tools is the standard library’s sync.Mutex{}. What Problem Do Mutexes Solve? We don’t want multiple threads accessing the same memory at the same time. In concurrent programming, we have many different threads (or in … Read more Golang Mutexes – What Is RWMutex For?

Best Practices For Writing Clean Interfaces in Go

Interfaces allow us to treat different types as the same type when it comes to specific behaviors. They are central to a Go programmers toolbelt and are often used improperly by new Go developers… leading to hard to read and buggy code. Recap on Interfaces Let’s look to the standard library as an example of … Read more Best Practices For Writing Clean Interfaces in Go

How To Build JWT’s in Go (Golang)

By Lane Wagner – @wagslane on Twitter Go is becoming very popular for backend web development, and JWT’s are one of the most popular ways to handle authentication on API requests. In this article, we are going to go over the basics of JWT’s and how to implement a secure authentication strategy in Go! What is a … Read more How To Build JWT’s in Go (Golang)