code: func writeTaskData(ctl task.Controller, td *taskData) (err error) {
  	if ctl.State().TaskData, err = json.Marshal(td); err != nil {
  		return errors.Annotate(err, "could not serialize TaskData").Err()
  	}
  	return nil
  }
docs: // writeTaskData puts information about the task into invocation's TaskData.