code: func encode(data interface{}) ([]byte, error) {
  	if data == nil {
  		return nil, nil
  	}
  	buf := bytes.NewBuffer([]byte{})
  	enc := gob.NewEncoder(buf)
  	if err := enc.Encode(data); err != nil {
  		return nil, err
  	}
  	return buf.Bytes(), nil
  }
docs: // encode encodes data into a slice of bytes using the gob package.
  // All types are supported except recursive data structures and functions.