haykot.dev
  • Blog

  • Sql , Golang
    · November 18, 2024

    4 Tips for Working with Sqlc in Go

    This post shares 4 tips for effectively working with Sqlc in Go. It covers handling bulk updates with parameterized queries, using CASE and NULL for conditional filters, and organizing query types across packages to reduce type pollution. These strategies help maintain clean and scalable code when using Sqlc.

    9 Minute Read

  • Golang
    · February 28, 2024

    Pluggable Architecture in About 300 Lines of Code

    This blog post guides readers through implementing a pluggable architecture in Go using around 300 lines of code. It introduces the concept, outlines essential requirements, and walks through the plugin interface and runner.

    6 Minute Read

  • Golang , Programming
    · August 21, 2023

    Distributed Locking With PostgreSQL

    Learn how to use Postgres native feature to coordinate work across several processes, acting as a mutex.

    3 Minute Read

  • Golang , Programming
    · May 5, 2023

    Writing Generic Mappers in Go

    In this short post, we’ll look at a generic implementation of a mapper functions, and how to extend it to support some common use cases.

    4 Minute Read

  • Golang
    · March 28, 2023

    TIL Creating Transient Databases For Testing

    This post explores an approach to unit testing database-dependent code by implementing a single backing Postgres instance and a disposable database for each test case.

    2 Minute Read

  • Golang , Programming
    · January 18, 2023

    Reduce Boilerplate in Go Http Handlers with Go Generics

    In this article I’m going to walk through how I’ve been able to reduce boilerplate code and ensure that my handlers have consistent behavior across my application.

    9 Minute Read

  • Golang
    · December 8, 2022

    Go Errors Cheat Sheet 2022

    Error handling is a critical part of any software development project. In this post we’ll look at some of the common ways that you’ll handle errors in Go and a few of the common pitfalls that you’ll encounter.

    6 Minute Read

  • Golang , Homebox
    · November 13, 2022

    TIL Using Custom Marshaling in Go

    A quick look at how to use custom marshaling in Go and why you might want to.

    2 Minute Read

  • Golang
    · August 13, 2022

    Starter Http Client Abstraction In Go

    My go-to snippet for starting a simple HTTP client abstraction in Go.

    4 Minute Read

  • Programming , Golang
    · February 2, 2022

    TIL: Testing Parametrized URLs with Chi Router

    Today I learned that it’s possible to slightly decouple your http handler tests from your chi router. Well sort of…

    1 Minute Read

  • Golang
    · September 15, 2021

    Resources for new Gophers in 2021

    These resources have made all the difference in going from scratching my head, to actually writing an application that makes sense and that I’m excited to keep working on.

    4 Minute Read

hayden's headshot

hayden@haybytes.com

Stay in Touch


Hayden's Blog List

Explore Blog About Me RSS
Social Bluesky Github LinkedIn