RSSAmplifier

Blog

Articles on Dominik Honnef

Recent content in Articles on Dominik Honnef

honnef.coRSS feed ↗37 posts

Latest posts

What I worked on in 2024

This post provides a quick summary of the major things I’ve worked on in 2024. 
 
 Added support for Go 1.11–1.19 execution traces to the new Go trace parser. 
 Wrote honnef.co/go/safeish , a Go package containing helpers for unsafe
code. 
 Released Staticcheck 2024.1 , improving support for Go 1.22 and adding support
for Go 1.23. 
 Released Gotraceui 0.4.0…

Generating Netlify _redirects from Hugo

Hugo lets us add aliases to pages. This is useful to, for example, transition from an old URL scheme without breaking&#xA;existing links. &#xA; Hugo achieves this by generating additional HTML files, which contain <meta> tags to specify the canonical URLs and to&#xA;redirect to them. &#xA; However, if you host your Hugo site on Netlify, you might want to use its _redirects file instead. This…

My org-roam workflows for taking notes and writing articles

This article documents the entirety of my org-mode based workflows, from note-taking to generating a website. I&rsquo;ll&#xA;mention all relevant packages, applications, and configuration. &#xA; &#xA; The core of the workflows ¶ &#xA; &#xA; My workflows are based around org-roam , a personal knowledge management system built atop org-mode. At its core,&#xA;org-roam implements an index of notes,…

My thoughts on the Go Generics Draft

The following are my thoughts on the Go Generics Draft. I will focus on the things that I disagree with or think are&#xA;missing. &#xA; &#xA; Contracts are nice, but where is the operator overloading? ¶ &#xA; &#xA; To me, the generics problem has always also been a problem of operator overloading. Consider the basic example of a Sum&#xA;function: &#xA; contract Addable(t T) {&#xA; t +…

Harvesting email addresses from public Slacks

Over the last year, Slack, the communication tool for teams, has been becoming popular in the open source community,&#xA;replacing alternatives such as IRC and Gitter. This was – rightly so – surprising to the people behind Slack. After all,&#xA;Slack is designed for companies. This is evident in the lack of features that open communities would want, and the&#xA;presence of features and design…

Stripping Go ELF binaries is safe

A common misconception among Go developers is that stripping Go binaries – that is using the strip(1) Unix utility –&#xA;is unsupported and leads to broken programs. This misconception is perpetuated on mailing lists and other forums without&#xA;providing actual proof for why it is supposedly unsafe. &#xA; This article will try to explain how this misconception came to be and why it is not a real…

Managing Let&#39;s Encrypt certificates in Kubernetes with kube-cert-manager

Kubernetes provides a way of scheduling and managing resources such as containers, storage and load balancers in a&#xA;highly automatic and easy fashion. It&rsquo;s a prime example of Infrastructure as Code . &#xA; Let&rsquo;s Encrypt , by its use of the ACME protocol , provides a simple and automatic way of obtaining TLS certificates that&#xA;are trusted by all major browser vendors, completely…

Merging multiple git repositories

Today I had to merge a bunch of existing git repositories into a new monorepo . I had the following requirements: &#xA; &#xA; The entire history of each repository had to stay intact. This includes the requirement that git log -- somefile &#xA;works without needing any workarounds. &#xA; Each repository $repo should be merged into $repo in the monorepo. &#xA; Being able to merge new changes…

Statically compiled Go programs, always, even with cgo, using musl

(Click here to skip the flavor text and go straight to the commands.) &#xA; Most people appreciate the fact that Go programs compile statically, as it makes deploying Go programs a lot easier.&#xA;Unfortunately, they aren&rsquo;t always statically compiled. &#xA; Using cgo, either in a 3rd party package or in the standard library, usually requires linking to a libc. Both net and&#xA; os/user are…

An incomplete list of Go tools

Go is an amazing language, but not just because of its language features, but also because of its ecosystem and how easy&#xA;it is to write tools that operate on Go code. &#xA; While languages and frameworks like Java and .NET have popular IDEs (e.g. Eclipse and Visual Studio) that can do&#xA;formatting, refactoring, code generation etc, the Go ecosystem focuses on small standalone tools and…

What&#39;s happening in Go tip (2014-01-10)

It&rsquo;s 2014, we&rsquo;ve survived Christmas and New Year&rsquo;s Eve and the Go team has begun work on the next release. And thus the&#xA; What&rsquo;s happening in Go tip series has started again. &#xA; For this iteration of the series, there will be some small adjustments. The main change will be the lack of a strict&#xA;weekly cycle. There might be multiple articles a week, or none. This is…

Cross-compiling Go and hidden uses of cgo

One of Go&rsquo;s strengths is its built-in support for cross-compilation. Setting up and using cross-compilers in Go is&#xA;completely painless and mainly involves setting some environment variables. &#xA; There is, however, one drawback to cross-compiling Go programs: It&rsquo;s not possible to use cgo. Cgo is used for writing&#xA;bindings to C libraries so that they can be used directly in Go.…

What&#39;s happening in Go tip (2013-09-20)

&#xA; Go 1.2 Release Candidate 1 released ¶ &#xA; &#xA; This week&rsquo;s article will be very short. Why? Because the first release candidate of Go 1.2 has been released! And&#xA;because that release includes a list of all changes – many of which I have covered before as well as all the ones I&#xA;haven&rsquo;t yet – there is little point to reiterating them all again here. &#xA; Go check out the…

What&#39;s happening in Go tip (2013-09-13)

This week we&rsquo;ll concentrate on changes to go vet and gofmt , two important parts of Go&rsquo;s tooling, as well as some&#xA;changes to cgo, some of which are especially important to users of OS X. &#xA; &#xA; What&rsquo;s happening ¶ &#xA; &#xA; &#xA; Improved go vet &#xA; Improved gofmt &#xA; Changes to cgo &#xA; &#xA; &#xA; Improved go vet ¶ &#xA; &#xA; Relevant CLs: CL 12936046 , CL…

What&#39;s happening in Go tip (2013-09-07)

Welcome back to yet another update on Go tip. We&rsquo;ll be looking at another batch of smaller changes from all over the&#xA;place; there&rsquo;s something for everyone. &#xA; And if you&rsquo;re waiting for some juicier changes, let me just say that they&rsquo;re on my radar, but I am reserving them for&#xA;the finale. Well, really for the big hole that the feature freeze will cause. &#xA;…

What&#39;s happening in Go tip (2013-08-30)

Welcome back to another week of Go tip. This time we&rsquo;ll mostly be focusing on smaller changes and API improvements.&#xA;Enjoy! &#xA; &#xA; What&rsquo;s happening ¶ &#xA; &#xA; In this week&rsquo;s article we will be looking at: &#xA; &#xA; Go becoming a better citizen &#xA; Support for encoding GIF images &#xA; User-extensible compression methods for archive/zip &#xA; Easier hashing with MD5…

What&#39;s happening in Go tip (2013-08-23)

Last week I published the first article in an ongoing series on changes in Go tip. It was met with a lot of positive&#xA;feedback, so here&rsquo;s the second article. Thank you for your support and I hope you enjoy this article just as much as the&#xA;previous one. &#xA; &#xA; What&rsquo;s happening ¶ &#xA; &#xA; This time we&rsquo;ll be looking at: &#xA; &#xA; A new slicing syntax &#xA;…

What&#39;s happening in Go tip (2013-08-15)

This is the first part of an ongoing series on changes and developments in Go tip, i.e. the development branch of Go. &#xA; In this series I intend to look at noteworthy recent CLs 1 and proposals and comment on their significance and&#xA;impact. For CLs, I will be concentrating on those that have either been already committed or that have been rejected, if&#xA;they had been of significance. For…

Writing Go in Emacs (cont.)

Back in Mach I demonstrated various ways in which go-mode can help you write Go more efficiently. &#xA; Today I want to post a quick follow-up, showing two new ways to improve your performance. One is a very handy 3rd party&#xA;package, while the other is a direct addition to go-mode. &#xA; &#xA; go-eldoc.el ¶ &#xA; &#xA; go-eldoc.el by Syohei Yoshida implements ElDoc functionality for go-mode.…

Writing Go in Emacs

Using the right tools plays a big role in getting your job done efficiently. In the case of programming Go, most of your&#xA;time will be spent in an editor. It is therefore key that your editor doesn&rsquo;t get in your way and, optimally, assists&#xA;you wherever it can. &#xA; In this article, I will talk about go-mode for Emacs, its history and features, as well as useful extensions to it.

Go: on implicit type conversions, type identity and a little gotcha

A well known design decision in the Go programming language is the absence of implicit type conversions. An int is&#xA;always an int and not an int32 and certainly not a float . And a net.IP is not a []byte &hellip; or is it? &#xA; Knowing only the &ldquo;no implicit type conversions&rdquo; principle, the following code should not compile: &#xA; package main&#xA;&#xA;import (&#xA; "fmt"&#xA;…

Dealing with encodings in Go

One not well documented aspect of Go is how it handles string encodings, or how strings are actually treated internally.&#xA;This article tries to shed some light on basic aspects of that, to get you started. &#xA; &#xA; It&rsquo;s all UTF-8, right? ¶ &#xA; &#xA; A source of confusion is the fact that Go source code has to be encoded in UTF-8, meaning that string literals,&#xA;variable/function…

Breaking backwards compatibility in good conscience

A couple of days ago I released Cinch 2.0 – version 2.0 of the most-used IRC library written in Ruby. The purpose of&#xA;this article, however, is not to talk about all the new features and improvements in Cinch (check the changelog if&#xA;you&rsquo;re curious) but why it breaks backwards compatibility and how that&rsquo;s not a bad thing. &#xA; The Ruby community basically has two main camps:…

Linux RAID &#43; dm-crypt: poor write performance

I&rsquo;ve been running a RAID 6 with four active disks for quite some time now, and performance always seemed adequate,&#xA;achieving about 230MB/s read and 90MB/s write (obviously in rather artifical tests using dd; actual file operations&#xA;might vary). &#xA; Now it occured to me, that encrypting my data might actually be a good idea, so I looked into cryptsetup for adding&#xA;encryption on…

Electronics: my first experiences with various shops

This is part three of a series of me describing my new experiences with electronics. &#xA; First of all, sorry for the late third article, but ever since I received my Arduino I was really busy playing around&#xA;with it. &#xA; Quite a bit has happened since my last article and I will try to catch up as quickly as possible. One thing that&#xA;happened is that I had to order quite a bit more tools…

Electronics: starting small

This is part two of a series of me describing my new experiences with electronics. &#xA; As I said in my last post, I want to start with simple hardware. The reasons for this should be pretty obvious: neither&#xA;do I have a concrete idea for a project, nor am I certain that I&rsquo;ll stay interested for long enough. Consequently, I&#xA;don&rsquo;t want to spend too much money. &#xA; A rough…

Electronics: introducing myself to the world of electronics

This is part one of a series of me describing my new experiences with electronics. &#xA; &#xA; Introduction ¶ &#xA; &#xA; I&rsquo;ve never really been interested in electronics (i.e. circuits, microcontrollers etc). Sure, I understand, on a basic&#xA;level, how most of the gadgets and computers that I own work, but I wouldn&rsquo;t be able to build anything myself or explain&#xA;what e.g. a diode…

SketchUp Plugin: Selection Manager

Disappointed with SelectionMemory and not willing to pay $5&#xA;for SelectionMemory2 (not mentioning the bad interface it has), I went&#xA;to write my own plugin for saving and restoring selections. &#xA; The main benefits compared to other solutions are: &#xA; &#xA; It is free &#xA; It has no artificial limit with regard to how many selections can be saved &#xA; It is driven via the context menu…

rsemantic — Latent Semantic Analysis for Ruby

&#xA; Introduction ¶ &#xA; &#xA; Some time ago, I started reading Where Good Ideas Come From: The Natural History of Innovation and one thing it&#xA;mentions is an application called &ldquo;DEVONthink&rdquo;. DEVONthink is an application you&rsquo;d use for storing all kind of documents&#xA;(RSS feeds, emails, notes, articles) and the by far most interesting feature is its ability to recommend…

Why you should try tmux instead of screen

&#xA; What screen is ¶ &#xA; &#xA; If you&rsquo;re reading this article, you probably already know what GNU Screen is: the most well-known terminal multiplexer&#xA;in the world of Unix. If that doesn&rsquo;t ring any bells, I recommend reading the Wikipedia article about GNU Screen before&#xA;continuing with this article. &#xA; &#xA; An Alternative ¶ &#xA; &#xA; There are, however, also some other…

Newton and Cinch — One awesome framework

A lot of time (3 months, actually) has passed since I&rsquo;ve last blogged about Ruby and available IRC frameworks for&#xA;writing bots . Back then I planned to fork Isaac or Cinch, in order to add proper abstraction and object-orientation to&#xA;them. Well, I did fork Isaac, realized that it was, in all honesty, quite a mess and instead wrote my own framework,&#xA;mostly from scratch. I did,…

Are lightweight IRC frameworks too lightweight?

Recently I&rsquo;ve been looking for a small framework for writing IRC bots in Ruby. Admittedly, I have been successfully&#xA;running a bot based on Butler for quite some time now, but I have always been looking for a more lightweight&#xA;solution, which does not come with a predefined plugin or authentication structure. &#xA; Now there are probably three major players in the field of IRC bots,…

Dynamically defining a method on a single instance in Ruby

Given the following initial code… &#xA; class Dog&#xA; def initialize(name)&#xA; @name = name&#xA; end&#xA;&#xA; def bark&#xA; puts "woof"&#xA; end&#xA;end&#xA;&#xA;charlie = Dog.new("Charlie")&#xA;lucas = Dog.new("Lucas")&#xA; &#xA; … one might want to teach one of the dogs a new trick, while the others shouldn&rsquo;t automatically learn it. One possible&#xA;solution could look like the…

About getting help on IRC

There is one thing that either we, the helping people, or those that&#xA;search for help with their code don&rsquo;t get, and that&rsquo;s what&#xA;kind of answers are to be expected. &#xA; Every too often I see people joining certain channels, in particular&#xA;#ruby and #ruby-lang, asking questions about why their code&#xA;doesn&rsquo;t work or how to implement feature XY. And of course…

Apache behind a remote lighttpd proxy and the caveats

&#xA; Background ¶ &#xA; &#xA; The subdomain I use belongs to a friend, who isn&rsquo;t able to set A or CNAME entries, so he uses lighttpd + mod_proxy to&#xA;redirect it to my server. &#xA; &#xA; The Problem ¶ &#xA; &#xA; And that&rsquo;s where the problems started. Because of the proxy, the HTTP REMOTE_ADDR isn&rsquo;t the one of the visitor anymore&#xA;but the one of the proxy, which in turns…

Only call super when possible

Today we were faced with an interesting question in #ruby-lang: &#xA; &#xA; <Judofyr> is there a way to find out if it&rsquo;s safe to call &ldquo;super&rdquo;?&#xA;<Judofyr&> aka. it’s defined on the superclass &#xA; &#xA; After some ugly solutions (like self.class.ancestors.any? and super rescue nil ) apeiros came up with a nicer one: &#xA; &#xA; <apeiros_> super if defined? super &#xA; &#xA;…

&#34;Smalltalk Best Practice Patterns&#34; reviewed

Today I read the first volume of Smalltalk Best Practice Patterns, or to be precise, a draft I found on Google. While I&#xA;am a Ruby programmer and never even touched Smalltalk in my life, it is an undeniable fact that Ruby and Smalltalk have&#xA;many things in common, or to put it in another way, that Ruby (or any real OO language really) was inspired by&#xA;Smalltalk. &#xA; The book is, like…