Also a good example of programmer masochism, there's absolutely no good reason for
zd, err := gzip.NewReader(fd)
to return an error rather than waiting for an actual read. The stdlib is usually pretty good about this but third-party libraries are rife with this kind of misdesign.