RSSAmplifier

Blog

Blog on Applied Go

Recent content in Blog on Applied Go

appliedgo.netRSS feed ↗46 posts

Latest posts

From Go Code to Homebrew Tap: Writing and Deploying a Whisper CLI with GoReleaser

If an existing tool is not straightforward to use, a software developer's natural reflex is to write a tailor-made CLI. Akash Joshi wrapped OpenAI's Whisper model into an intuitive command-line interface, packaged it with GoReleaser, and distributed it via Homebrew. Here are the steps for you to steal.

Beyond the Debugger: A Comprehensive Guide to Debugging Go Applications

Not all bugs are created equal. Some may be easy to pinpoint and eliminate with the help of a debugger. Others might be subtle or infrequent, and tracking them down is like searching for a needle in a haystack. Choosing the right debugging technique can significantly raise the chance of success while reducing the time to get there.

Go One-Two-Three: My Favorite Features of Go Release 1.23

TL;DR: Go now officially supports ranging over function iterators, adds opt-in telemetry, is WAY faster when building with Profiled Guided Optimization enabled, fixes garbage collection of tickers and timers, and provides useful updates to many packages of the standard library. Get it while it's hot!

Distributed Computing With Dried, Salted Cod Fish, WASM, And (Tiny)Go

You don't need monstrous software orchestration systems for collecting information from distributed data sources. Here is an easy way of sending a Go binary to where the data is.

SQL as API in Go

So your API needs to allow queries that are too complicated for plain CRUD APIs but not complicated enough to justify using GraphQL? Consider accepting a subset of SQL where clauses, with the necessary security checks implemented in Go.

Continuous refresh, or: how to keep your API client authorized

An access token should be initialized and refreshed from a central place, yet be available to umpteenth of client sessions. Dynamic futures to the rescue.

Poetry time! Go proverbs as limericks

The Go proverbs capture the essence of Go. Too concise for your taste? No worries, here is each proverb explained in a limerick.

AI times three—or how I made AI write a blog post for me

Writing a concurrency-safe hashmap in Go is dead easy, even an AI can do it! To prove this, I had three AI tools write this blog article, generate Go code, and create an opening image.

How I used Go to make my radio auto-switch to AUX-IN when a Raspi plays music

Ok, so your radio lacks AirPlay support but has an auxiliary input and can be remote-controlled via the Frontier Silicon API. Fetch a Raspberry Pi, put Shairport-sync and Raspotify on it, plug it into the AUX port, and glue everything together with some Go code. Et voilà - home automation in the small.

Rapid AWS Lambda development with Go and Mantil

If you need to develop an AWS Lambda function in Go, take a look at Mantil, a dev kit with staging and database connection included.

Instant Go

Edit and run Go code right in the browser. No backend required.

How I turned a binary search tree into a generic data structure with go2go

Some time ago I wrote about how to create a balanced binary search tree. The search keys and the data payload were both plain strings. Now it is time to get rid of this limitation. go2go lets us do that while waiting for the official generics release.

How to become the richest person on earth (and learn some Go along the way)

Ok, to be frank, this article is mostly about the second part of the title. We will build a market simulation with minimal Go code, and show how the rich get richer even when they are not greedy at all.

Packaging a project release (goreleaser part 2)

In the previous post, I used goreleaser to add binaries to a project release. Now let's have goreleaser build a Homebrew formula as well. Automatically, and for macOS and Linux alike.

CLI tools FTW (or: how to distribute your CLI tools with goreleaser)

“go get” is a super-simple way of installing Go binaries, but not everyone has a Go compiler installed. If you want to make your CLI tools and apps available to the world, have a look at goreleaser.

Cannot import main: a Go Module gotcha

Two questions for you: Do you name an app module simply “main”? And do you happen to write tests for a main package? If so, you are in big trouble! (Ok, that was a bit clickbait-ey…) Well, the world is not exactly going to end; however, you might encounter an unexpected error that is hard to track down.

Futures in Go, no package required

Futures are mechanisms for decoupling a value from how it was computed. Goroutines and channels allow implementing futures trivially. Does this approach cover all aspects of a future?

what.Happens - a debug logging package for developers only

Package what provides some handy debug-logging functions that can be enabled and disabled via build flags. No more information leaks in your production code!

Slow down your code with goroutines

Or: How adding goroutines can keep your CPU busy shuffling things around.

In the news: Go on AWS Lambda

Just recently, Amazon announced support for Go on AWS Lambda. Here is a summary of last week's news around this topic.

How to Create PDF Documents

Pure data is for computers and nerds like you and me. Anyone else likes nicely formatted reports. Go and a good PDF package can help.

Processing spreadsheet data in Go

Your managers, all through the hierarchy, love circulating spreadsheets via email. (They simply don't know better.) How to extract and analyze the relevant data from the daily mess? Go can help.

A DIY Dashboard with Grafana

If your code creates some stats to monitor, Grafana and the Grada package may come in handy.

Go slices are not dynamic arrays

Go's slices are cleverly designed. They provide the look-and-feel of truly dynamic arrays while being optimized for performance. However, not being aware of the slice mechanisms can bring you into trouble.

goman - the missing man pages for Go binaries

Most Go binaries come without any man page. The tool goman fills this gap. If the corresponding project includes a decent README file (and most projects do), goman find this README file and displays it on the terminal.

Controlling a Digispark board

The Digispark is perhaps as small as a microcontroller board for DIY electronics can get. This is a short writedown about my first experiences with controlling this board through Go code, using Gobot and LittleWire.

Big Oh!

You worked hard to save a few CPU cycles in the central loop, but your code is still slow? Time to think about the time complexity of your algorithm.

Text-Based User Interfaces

Want to equip your command-line application with a nice visual user interface? TUI libraries are here to help.

Flow To Go

If you want to do Flow-Based Programming in Go, there are a couple of frameworks and libraries available. Or you simply do it with pure Go. After all, how difficult can it be?

Get into the flow

In Flow-Based Programming, programs are modeled as data flowing between independent processing units. Who would not think of channels and goroutines as a natural analogy?

TCP/IP Networking

Connecting two processes at TCP/IP level might seem scary at first, but in Go it is easier than one might think.

Picturesque!

Let's face it: Pictures taken with a smartphone usually aren't quite like Ansel Adams masterpieces. But with a little post-processing, some of them might still reveal their true beauty. A couple of Go libraries can help.

MapReduce - munching through Big Data

How Google tackled the problem of processing enormous amounts of data, and how you can do the same with Go.

Deliver my data, Mr. Json!

JSON is the lingua franca of exchanging data over the net and between applications written in different programming languages. In this article, we create a tiny JSON client/server app in Go.

A Random Blog Post

How to generate random numbers, and the difference between math/rand and crypto/rand.

Take a REST!

RESTful Web API's are ubiquitous. Time for a minimalistic, five-minutes video tutorial about REST, RESTful API's, and buidling a REST server in Go.

Regular Expressions demystified

Regular Expressions are slow, ugly, error-prone, incomprehensible,… Or are they? Find out by learning regexp basics.

Balancing a binary search tree

Only a well-balanced search tree can provide optimal search performance. This article adds automatic balancing to the binary search tree from the previous article.

A Binary Search Tree

Search trees are everywhere: In databases, in file systems, in board game algorithms,… This post explores the probably most basic form of a tree: a binary search tree.

Who needs generics? Use ... instead!

What are generics? Why are they considered useful? Why does Go have no generics? What shall Gophers use instead? This article examines the nature of generics, and surveys various techniques that can be used to work around the absence of this programming paradigm.

Plugins in Go

Go is a statically compiled language. The Go runtime cannot load dynamic libraries, nor does it support compiling Go on the fly. Still, there is a number of ways of creating and using plugins in Go.

Dependency Injection in a nutshell

Layered software architectures adhere to the Dependency Rule: Source code in a lower-level layer can make use of code in higher-level layers, but never vice versa. Control flow, however, goes in both directions. How is this possible, given that higher-level code must not know anything about the code in lower levels?

Inverse Kinematics: how to move a robotic arm (and why this is harder than it seems)

So you have built a robotic arm? Great, let's write some Go to make it serve your five o'clock tea. Sounds simple enough. Or is it?

Perceptrons - the most basic form of a neural network

Artificial Neural Networks have gained attention during the recent years, driven by advances in deep learning. But what is an Artificial Neural Network and what is it made of? Meet the perceptron.

Message Queues Part 2: The PubSub Protocol

This is the second (and, for the time being, the last) article about messaging and Mangos. After doing first steps with the Pair protocol, we now look into a slightly more complex protocol, the Publisher-Subscriber (or PubSub) protocol.

Message Queues, or how you can make processes talk to each other

Consider two processes that need to exchange commands and data. You want to connect them in a way that is straightforward, efficient, and reliable. How would you do that? Enter Message Queues.