code: func (jt *Type) encodeData(data interface{}) ([]byte, error) {
  	// Check the type of data
  	dataType := reflect.TypeOf(data)
  	if dataType != jt.dataType {
  		return nil, fmt.Errorf("jobs: provided data was not of the correct type.\nExpected %s for Type %s, but got %s", jt.dataType, jt, dataType)
  	}
  	// Encode the data
  	encodedData, err := encode(data)
  	if err != nil {
  		return nil, fmt.Errorf("jobs: error encoding data: %s", err.Error())
  	}
  	return encodedData, nil
  }
docs: // encodeData checks that the type of data is what we expect based on the handler for the Type.
  // If it is, it encodes the data into a slice of bytes.