Blog

Posts

Using dot imports in views in Go

I listened to an episode of the GoTimeFM podcast recently, about what the panelists would remove from the Go language, if it were possible if not for the Go version 1 backwards compatibility guarantee.

Ironically, this got me thinking about a nice use case for dot imports: when using the gomponents view library I'm building.

Read the rest of "Using dot imports in views in Go"…

Creating a Docker image for a Go application

The Go compiler produces a nice, single binary that's easy to deploy already. However, sometimes it's convenient to containerize your application. In this blog post, I'll show you a Dockerfile you can use as a template, and give you the reasoning behind each line in it.

Read the rest of "Creating a Docker image for a Go application"…

Structuring and testing HTTP handlers in Go

There are many ways to structure your HTTP handlers in your web application code in Go. It would be nice to have a default way to do this. After quite a few different designs, I've found a way I like, and in this post, I'll show you.

Read the rest of "Structuring and testing HTTP handlers in Go"…

gomponents: declarative view components in Go

I miss building views like in the React/Javascript world when in Go-land.

There's something so natural about thinking your view in terms of being built out of components. Everything from the buttons you use everywhere, to the big, interactive pages that pull everything together, it just feels easy to build pages from these building blocks.

Read the rest of "gomponents: declarative view components in Go"…

Authentication for REST APIs in Go

There are many options and opinions on how to add authentication and authorization to an HTTP REST API in Go. I was looking for something to let me provide simple username and password-based authentication in my web projects, no third-parties involved. In this post, I will provide the solution that I found to be the simplest, most battle-tested of all.

Read the rest of "Authentication for REST APIs in Go"…

Introductions

Hi, I'm Markus. 😊 I'm a professional software developer specialising in backend web services and distributed systems, but I also like building web products, full-stack style. I've been building web sites and programming since my early teens.

Read the rest of "Introductions"…

Newsletter

Is what I write useful to you? Sign up to my newsletter for software and business insights directly in your inbox. 😄 You could also use plain old RSS.