How to build Go containers

I used Docker to containerize projects like Bender and my custom OTel Collector. However, after glancing at one of the projects my teammates were working on, I decided to take a look at ko. Oh my gosh! Ko is such a magnificent tool! It brings the simplicity, efficiency, and fun of Go to containerization. If you need to build a container for your Go app, stop searching and start using ko. To build a container, you don’t need Docker. Pick your favorite registry, for example, the GitHub Container Registry, and: ...

February 17, 2025 · 1 min · 187 words · Maurizio Branca

How to replace an external Go dependency with a local copy

The Problem You’re using a great open source library in your project, and then, one day, you find yourself thinking: “Oh, wouldn’t be great if the author just added a tiny little log statement in that function?”. Yeah, it really would, this would allow me to trace the value of that variable or try a small change. What can you do: fork the library? Nope. Don’t do that. Replace it! You can temporarily replace the original module with a local copy, changing one line in your go.mod file. ...

February 5, 2021 · 2 min · 220 words · Maurizio Branca