Re-implement klvgen in Go for fun.