code: func Encode(v interface{}) ([]byte, error) {
  	var buf bytes.Buffer
  	zw := zlib.NewWriter(&buf)
  	enc := json.NewEncoder(zw)
  
  	if err := enc.Encode(v); err != nil {
  		zw.Close()
  		return nil, errors.Annotate(err, "failed to JSON-encode").Err()
  	}
  	if err := zw.Close(); err != nil {
  		return nil, errors.Annotate(err, "failed to Close zlib Writer").Err()
  	}
  	return buf.Bytes(), nil
  }
docs: // Encode is a convenience method for generating a ZLIB-compressed JSON-encoded
  // object.