update encoder for go 1.2