Binary struct encoder for Go